FAQ

# R>r-help>November 2011

## 849 discussions - 2,905 posts

• 21

#### [R] On-demand importing of a package

Dear All, in some functions of my package, I use the Matrix S4 class, as defined in the Matrix package. I don't want to depend on Matrix, however, because my package is perfectly fine without Matrix, ...
 Gábor CsárdiNov 22, 2011 at 8:16 pmNov 25, 2011 at 9:25 pm
• 20

#### [R] Upgrade R?

I am trying to upgrade to R 2.14 from R 2.13.1 I have compied all the libraries from the 'library' directory in my existing installation (2.13.1) to the installed R 2.14. Now I want to uninstall the ...
 Kevin BurtonNov 7, 2011 at 8:23 pmNov 16, 2011 at 2:22 pm
• 15

#### [R] Objects disappearing in my R work space

I am running MCMC chains with a self written MCMC algorithm. When I have multiple R terminals open while running the Chain, when it finishes it is not there. when I press ls() it does not show up and ...
 AldoNov 24, 2011 at 3:50 pmNov 26, 2011 at 12:59 am
• 15

#### [R] package installtion

I'm getting the following error in a script: "Error: could not find function "lmer."??? I'm wondering of my lme4 package is installed incorrectly.? Can someone tell me the installation procedure?? I ...
 Scott RaynaudNov 15, 2011 at 7:50 pmNov 17, 2011 at 6:45 pm
• 14

#### [R] optim seems to be finding a local minimum

Hello! I am trying to create an R optimization routine for a task that's currently being done using Excel (lots of tables, formulas, and Solver). However, otpim seems to be finding a local minimum ...
 Dimitri LiakhovitskiNov 10, 2011 at 6:50 pmNov 17, 2011 at 4:00 pm
• 14

#### [R] Interpreting Multiple Linear Regression Summary

I would appreciate pointers on what I should read to understand this output: summary(lm(TDS ~ Cond + Ca + Cl + Mg + Na + SO4)) Call: lm(formula = TDS ~ Cond + Ca + Cl + Mg + Na + SO4) Residuals: ALL ...
 Rich ShepardNov 9, 2011 at 5:04 pmNov 9, 2011 at 9:00 pm
• 13

#### [R] [OT] 1 vs 2-way anova technical question

Hello, I know there is plenty of people in this group who can give me a good answer :) I have a 2^k model where k=4 like this: Model 1) R~A*B*C*D If I use the "*" in R among all elements it means to ...
 Giovanni AzuaNov 21, 2011 at 11:04 amNov 22, 2011 at 3:02 pm
• 13

#### [R] Web based R-help not a list

Hello, Is there a web version of this R-Help user group (such as the ones under Google Groups) such that 1. I can do a search on any topic over thousands of posts on R easily and effectively 2. My ...
 Cem GiritNov 9, 2011 at 10:38 pmNov 11, 2011 at 5:29 am
• 12

#### [R] Missing data?

I was wondering what the best approach is for missing data in a time series. I give an example using xts but I would like to know what seems to be the "best" method. Say I have library(xts) xts.ts <- ...
 Kevin BurtonNov 22, 2011 at 9:00 pmNov 28, 2011 at 1:35 am
• 11

#### [R] Negative exponential fit

We need help.... We are doing a project for a statistical class in and we are looking at world record times in different running events over time. We are trying to fit the data with a negative ...
 Rch4Nov 29, 2011 at 3:09 amNov 30, 2011 at 4:36 pm
• 11

#### [R] generating a vector of y_t = \sum_{i = 1}^t (alpha^i * x_{t - i + 1})

Dear R-help, I have been trying really hard to generate the following vector given the data (x) and parameter (alpha) efficiently. Let y be the output list, the aim is to produce the the following ...
 Michael KaoNov 27, 2011 at 12:20 amNov 27, 2011 at 9:30 pm
• 11

#### [R] Looping and paste

Dear R helpers I'm trying to make up some labels for plot from this vector BndY<-seq(from = 18900,to= 19700, by = 50) using Ylab<-for(i in BndY) {c((paste(i," to ",i+50,"mN")))} but the vector ...
 Markm0705Nov 23, 2011 at 10:26 pmNov 24, 2011 at 8:37 pm
• 11

#### [R] Scatter plot - using colour to group points?

Dear All, I am very new to R - trying to teach myself it for some MSc coursework. I am plotting temperature data for two different sites over the same time period which I have downloaded from a ...
 SarahHNov 21, 2011 at 7:17 pmNov 23, 2011 at 5:08 pm
• 11

#### [R] why NA coefficients

Call: lm(formula = y ~ factor(treat) * factor(group), data = test) Coefficients: ????????????????? (Intercept)???????????????? factor(treat)2???????????????? factor(treat)3? ???????????????????? ...
 Array chipNov 8, 2011 at 12:33 amNov 8, 2011 at 7:32 pm
• 10

#### [R] x, y for point of intersection

Hi everyone, ? I am trying to get a point of intersection between a polyline and a straight line ?.. and get the x and y coordinates of this point. For exemplification consider this: ? ? ...
 Monica PisicaNov 22, 2011 at 8:40 pmDec 1, 2011 at 2:37 pm
• 10

#### [R] "Non-finite finite-difference value" error in eha's aftreg

Hi list! I'm getting an error message when trying to fit an accelerated failure time parametric model using the aftreg() function from package eha: This only happens when adding four specific ...
 Milan Bouchet-ValatNov 16, 2011 at 2:06 pmDec 1, 2011 at 11:08 am
• 10

#### [R] Transforming a string into a command

I would like to make a string executable, e.g, s<- "ln(a+b)" a<-1 b<-2 ???? execute string s to obtain ln(a+b) ???? How can I make it? Ciao fron Rome Vittorio
 VictorNov 27, 2011 at 10:16 amNov 29, 2011 at 6:13 pm
• 10

#### [R] Reading a file w/ two delimiters

Hi all, I've been scratching and poking, but basically, the file I need to read has two delimiters that I need to contend with. The first is that the file contains tabs (\t) , instead of newlines ...
 Langston, JimNov 18, 2011 at 12:37 pmNov 18, 2011 at 6:56 pm
• 10

#### [R] Pairwise correlation

Dear All, I am not familiar with R yet I want to use it to perform some task, hence my posting here. I hope someone can help. I have a set of data, genes (rows) and samples (columns). I want to do a ...
 Muzz56Nov 16, 2011 at 4:37 pmNov 18, 2011 at 2:35 am
• 10

#### [R] R development master class: NYC, Dec 12-13

Hi all, I hope you don't mind the slightly off topic email, but I'm going to be teaching an R development master class in New York City on Dec 12-13. The basic idea of the class is to help you write ...
 Hadley WickhamNov 13, 2011 at 5:34 pmNov 15, 2011 at 10:36 pm
• 10

#### [R] reorder data.frame

Hello, I very general question but probably usefull to others as well: Is there any prebuild function that reorders a dataframe from: x1 x2 1 100 200 2 101 201 3 102 202 4 103 203 5 104 204 6 105 205 ...
 Johannes RadingerNov 9, 2011 at 3:14 pmNov 10, 2011 at 12:14 pm
• 10

#### [R] Sampling with conditions

Hey everyone, I am at best, an amateur user of R, but I am stuck on how to set-up the following situation. I am trying to select a random sample of numbers from 0 to 10 and insert them into the first ...
 SarahJoyesNov 7, 2011 at 10:22 pmNov 8, 2011 at 8:31 pm
• 10

#### [R] nested "for" loops

Hi all , I have written a code with nested "for" loops . The aim is to estimate the maximum likelihood by creating 3 vectors with the same length( sequence ) and then to utilize 3 "for" loops to make ...
 Nick_panNov 4, 2011 at 11:49 pmNov 6, 2011 at 4:22 am
• 9

#### [R] Problem in log

Hi all I have a function of log defined by y = log(1- exp(-a)), when exp(-a) is greater, 1, it produce NaN. How can I remove this in R?
 Gyanendra PokharelNov 29, 2011 at 10:02 pmNov 30, 2011 at 6:49 pm
• 9

#### [R] Convert back to lower triangular matrix

Given a vector; ab = seq(0.5,1, by=0.1) ab[1] 0.5 0.6 0.7 0.8 0.9 1.0 The euclidean distance between the vector elements is given by the lower triangular matrix dd1 = dist(ab,"euclidean") dd1 1 2 3 4 ...
 Juliet NdukumNov 15, 2011 at 10:38 pmNov 17, 2011 at 11:57 am
• 9

#### [R] Named components in a list

I'm studying lists and I came to an example where $name [1] "Fred"$wife [1] "Mary" $no.children [1] 4$child.ages [1] 4 7 9 then following the instructions to extend the list with a new component, I ...
 JulioSergioNov 10, 2011 at 6:55 pmNov 10, 2011 at 11:44 pm
• 9

#### [R] window?

Can someone enlighten me on why the following doesn't work? setwd('C:/Temp/R') d <- rep(1:53,2) (s <- ts(d, frequency=53, start=c(2000,10))) n <- length(s) k <- n%/%3 for(i in (n-k):n) { st <- ...
 Kevin BurtonNov 8, 2011 at 3:26 pmNov 9, 2011 at 3:18 pm
• 9

#### [R] How much time a process need?

Dear all, I have finished a large function that takes around 1 day to finish. I was using system.time(callmyfunction()) to measure how much time it needed to finish, my problem is that I do not know ...
 AlaiosNov 7, 2011 at 10:09 amNov 8, 2011 at 1:53 pm
• 8

#### [R] Adding units to levelplot's colorkey

How to add units (e.g. "cm") to the color key of a lattice levelplot? The plots looks fantastic, but it would be nice to indicate somewhere near the end of the color key that the values associated ...
 Carlisle ThackerNov 14, 2011 at 8:34 pmNov 24, 2011 at 12:59 am
• 8

#### [R] Very simple loop

I'm very new to R and am trying to create my first loop. I have: x <-c(0:200) A <- dpois(x,exp(4.5355343)) B <- dpois(x,exp(4.5355343 + 0.0118638)) C <- dpois(x,exp(4.5355343 -0.0234615)) D <- ...
 DavgNov 14, 2011 at 3:59 pmNov 18, 2011 at 7:21 pm
• 8

#### [R] Spatial Statistics using R

I am looking for online courses to learn Spatial Statistics using R. Statistics.com is offering an online course in December on the same topic but that schedule doesn't suit mine. Are there any other ...
 VioravisNov 17, 2011 at 6:28 amNov 18, 2011 at 10:14 am
• 8

#### [R] regular expression for selection

Dear all I am again (as usual) lost in regular expression use for selection. Here are my data: c("138516_10g_50ml_50c_250utes1_m53.00-_s1.imp", "138516_10g_50ml_50c_250utes1_m54.00_s1.imp", ...
 Petr PIKALNov 14, 2011 at 8:45 amNov 14, 2011 at 10:31 am
• 8

#### [R] A question on Programming

Dear all. Let say I have a group of codes which will be used in many places in my overall R-code files. These group of codes will be used within a for-loop (with a big length, like 10000 times) and ...
 Christofer BogasoNov 10, 2011 at 3:07 pmNov 11, 2011 at 2:35 pm
• 8

#### [R] Stack trace?

Currently I have a for loop executing functions and at the end I get a message like: There were 50 or more warnings (use warnings() to see the first 50) If I do what it says and type warnings(), I ...
 RkevinburtonNov 9, 2011 at 9:35 pmNov 11, 2011 at 12:20 am
• 8

#### [R] ggplot stat_summary (mean_cl_boot)

Hello, This is a pretty simple question, but after spending quite a bit of time looking at "Hmisc" and using Google, I can't find the answer. If I use stat_summary(fun.data="mean_cl_boot") in ggplot ...
 Nathan MillerNov 9, 2011 at 7:59 pmNov 10, 2011 at 12:31 am
• 8

#### [R] building a subscript programatically

Hi, On ocasion, you need to subscript an array that has an arbitrary (ie. not known in advance) number of dimensions. How do you deal with these situations? It appears that it is not possible use a ...
 Ernest AdroguéNov 1, 2011 at 10:14 pmNov 2, 2011 at 3:10 am
• 7

#### [R] Question about randomForest

I've been using the R package randomForest but there is an aspect I cannot work out the meaning of. After calling the randomForest function, the returned object contains an element called prediction, ...
 Matthew FrancisNov 26, 2011 at 8:02 pmApr 4, 2012 at 6:18 pm
• 7

#### [R] cumsum in 3d arrays

Hello! Is it posible to apply /cumsum()/ along the 3rd dimension of 3D array? Something like matrlab function - /cumsum (*A*,dim)/ which returns the cumulative sum of the elements along the dimension ...
 ZloncaricNov 26, 2011 at 2:32 pmNov 29, 2011 at 8:48 am
• 7

#### [R] (no subject)

Hello. I have this matrix: cy [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.0000000 1.0000000 -0.5164570 -0.5164087 -0.4004139 -0.4003719 [2,] 1.0000000 1.0000000 -0.5164570 -0.5164087 -0.4004139 -0.4003719 ...
 Rui EstevesNov 11, 2011 at 12:05 amNov 28, 2011 at 11:12 pm
• 7

#### [R] Binned line plot

I have a scatter plot with 10000 points.? I would like to add a line that bins every 50 points and connects the average of each bin.? I'm looking for something similar to line type "m" in Stata. With ...
 Jeffrey JohNov 22, 2011 at 5:29 amNov 27, 2011 at 1:00 pm
• 7

#### [R] proper work-flow with 'formula' objects and lm()

Dear all I have a work-flow issue with lm(). When I use Call: lm(formula = y1 ~ x1, data = anscombe) Coefficients: (Intercept) x1 3.0001 0.5001 I get as expected the formula, "y1 ~ x1", in the ...
 Liviu AndronicNov 24, 2011 at 7:48 pmNov 24, 2011 at 11:09 pm
• 7

#### [R] logistic regression by glm

HI I use glm in R to do logistic regression. and treat both response and predictor as factor In my first try: ******************************************************************************* Call ...
 TujchlNov 20, 2011 at 11:46 amNov 21, 2011 at 4:57 am
• 7

#### [R] Help

Dear Contributors I would like to perform this operation using a loop, instead of repeating the same operation many times. The numbers from 1 to 4 related to different groups that are in the database ...
 FrancescaNov 11, 2011 at 8:24 pmNov 18, 2011 at 5:03 pm
• 7

#### [R] linear against nonlinear alternatives - quantile regression

Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this ...
 Julia LiraNov 5, 2011 at 2:05 pmNov 16, 2011 at 11:05 pm
• 7

#### [R] With an example - Re: rbind.data.frame drops attributes for factor variables

When I use rbind() or rbind.data.frame() to add a row to an existing dataframe, it appears that attributes for the column of type "factor" are dropped. See the sample example below to reproduce the ...
 Sammy ZeeNov 12, 2011 at 7:47 pmNov 15, 2011 at 4:51 pm
• 7

#### [R] rearrange set of items randomly

Dear all, I hope that this question is not too weird, I will try to explain it as good as I can. I have to write a function for a school project and one limitation is that I may not use the in built ...
 FlokkeNov 7, 2011 at 9:09 pmNov 14, 2011 at 8:36 pm
• 7

#### [R] Installing binaries from R-Forge

Hello, I'm attempting to install the splm package from R-Forge. https://r-forge.r-project.org/R/?group_id52 The page says, "In order to successfully install the packages provided on R-Forge, you have ...
 Downey, PatrickNov 9, 2011 at 12:39 pmNov 14, 2011 at 1:58 pm
• 7

#### [R] identify duplicate from more than one column

Hi all, I've searched everywhere to try to find out how to do this and have had no luck. I am trying to construct identifiers for couples in a dataset. Essentially, I want to identify couples using ...
 Jour4lifeNov 13, 2011 at 4:16 amNov 14, 2011 at 4:20 am
• 7

#### [R] Estimate of intercept in loglinear model

How does R estimate the intercept term \alpha in a loglinear model with Poisson model and log link for a contingency table of counts? (E.g., for a 2-by-2 table {n_{ij}) with \log(\mu) = \alpha + ...
 Colin AitkenNov 7, 2011 at 5:59 pmNov 8, 2011 at 6:58 pm
• 7

#### [R] Is it possible to vectorize/accelerate this?

Dear Members, I work on a simulaton experiment but it has an bottleneck. It's quite fast because of R and vectorizing, but it has a very slow for loop. The adjacent element of a vector (in terms of ...
 HihiNov 3, 2011 at 7:10 pmNov 3, 2011 at 10:53 pm
Group Navigation
 period ‹ prev | Nov 2011 | next ›
Group Overview
 group r-help categories r discussions 849 posts 2,905 users 778 website r-project.org irc #r

show more