similar to: Subscript Error

Displaying 20 results from an estimated 300 matches similar to: "Subscript Error"

2010 May 17
2
Problem with ldply
I've examining a number of linear regression models on a large dataset following the basic ideas presented here http://www.r-bloggers.com/r-calculating-all-possible-linear-regression-models-for-a-given-set-of-predictors/ Calculating all possible linear regressions . I run into a problem with ldply when I have a formula that includes no intercept. Here's a simple test to show what happens.
2012 Apr 29
1
r2 and p value dispaly in table
Hello R User, I was trying to display r.squared and p value in table from regression, but I could not display these parameters in the table (matrix) for example individual <- c(1,1,6,8,8,9,9,9,12,12) day <- c(4,17,12,12,17,3,9,22,13,20) condition <- c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71) test <- data.frame(individual, day, condition) ind.id <-
2011 Jul 14
1
glm() scale parameters and predicted Values
In glm() you can use the summary() function to recover the shape parameter (the reciprocal of the dispersion parameter). How do you recover the scale parameter? Also, in the given example, how I estimate and save the geometric mean of the predicted values? For a simple model you can use fitted() or predicted() functions. I will appreciate any help. ? ? ? #Call required R packages require(plyr)?
2018 Apr 17
0
Time intervals in a datframe
> On Apr 17, 2018, at 10:10 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote: > > > Hi all > > I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single
2010 Sep 09
0
Fast / dependable way to "stack together" data frames from a list
Hi, everybody: I asked about this in r-help last week and promised a summary of answers. Special thanks to the folks that helped me understand do.call and pointed me toward plyr. We face this problem all the time. A procedure generates a list of data frames. How to stack them together? The short answer is that the plyr package's rbind.fill method is probably the fastest method that is not
2008 Sep 30
0
New package: plyr
plyr is a set of tools that solves a common set of problems: you need to break a big problem down into manageable pieces, operate on each pieces and then put all the pieces back together. It's already possible to do this with split and the apply functions, but plyr just makes it all a bit easier with: * consistent names, arguments and outputs * input from and output to data.frames,
2008 Sep 30
0
New package: plyr
plyr is a set of tools that solves a common set of problems: you need to break a big problem down into manageable pieces, operate on each pieces and then put all the pieces back together. It's already possible to do this with split and the apply functions, but plyr just makes it all a bit easier with: * consistent names, arguments and outputs * input from and output to data.frames,
2011 Jun 03
0
ragged data.frame? using plyr
I have a dataset that looks like: set.seed(144) sam<-sample(1000,100) dat<-data.frame(id=letters[1:10],value=rnorm(1000),day=c(rep(1,100),rep(2,100),rep(3,100),rep(4,100),rep(5,100))) I want to "normalise" it using the following function (unless you have a better idea...): adj.values<-function(dframe){ value_mean<-mean(dframe$value) value_sd<-sd(dframe$value)
2010 Aug 09
2
coef(summary) and plyr
Dear all, I?m having trouble getting a list of regression variables back into a dataframe. mydf <- data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100)) mydf$fac<-factor(sample((0:2),replace=T,100)) mydf$y<- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100) dlply(mydf,.(fac),function(df) lm(y~x1+x2+x3,data=df))->dl here I?d like to use ldply(dl,coef(summary)) or something
2012 Mar 13
1
reshaping a dataset for a network
dear all, apologizes for bothering with a probably stupid question but I really don' t know how to proceed. I have a dataset which look like df a <- c(1,2,3,4,4,4,5,5) b <- c(11,7,4,9,8,3,12,4) df <-cbind(a,b) I would like to have one which looks like this: a 1 11 2 7 3 4 4 9 8 3 5 12 4 a are vertex of a network, b the edges. In the data the lenght of a is about 50000 I read
2018 Apr 17
2
Time intervals in a datframe
Hi all I have a list of multiple datframes with the same column headers. The last column in each datframe contains a vector of "Interval" class after I have produced this column using "lubridate" package. I needed to convert my list of dataframes to be in a single dataframe for further analysis. I did this using the following syntax : SingleDataframe <- ldply
2011 Jul 08
1
binary conversion list to data.frame with plyr... AND NO LOOPS!
Happy weekend helpeRs! As usual, I'm stumped by R... My plan was to take an integer number, convert it to binary and wind up with a data.frame where each column is either 1 or 0 so I can see which bits are changing: bb<-function(i) ifelse(i, paste(bb(i %/% 2), i %% 2, sep=""), "") my.dat<-c(36,40,10,4) my.binary.dat<-bb(my.dat)
2012 Mar 18
1
Help with dlply, loop and column names
Hi, I have a dataframe basically like this: > head(asturias.gen2011[,c(1,4,9:14)]) municipio total upyd psoe pp iu fac tipo 440 Allande 2031 1.44 31.10 39.75 4.01 21.62 1000-10000 443 Aller 12582 1.37 33.30 37.09 15.53 10.35 10000-50000 567 Amieva 805 1.48 32.69 37.36 6.15 20.16 <1000 849
2012 Mar 21
1
Forloop/ifelse program problem and list of dataframes
Hello R Community, I don't post to these things often so excuse me if I stumble on my forum etiquette. This is a complex problem for me, which may require two forum entries, but I will try my best to be concise. Also, I am a self taught coder, so if my code is not to convention, your constructive criticism is always welcome. I need to split up a data frame by participant (gpsarc -
2011 Jul 23
0
Question about output from twitteR package
Dear R-List, I am trying to develop a tutorial on how to analyze network data from Twitter conversations for a network analysis class that I teach. I came across the twitteR package, and saw some examples of it in action on various websites. It is easy to use, and almost as easy to understand. I was able to pull sets of Twitter messages into a dataframe using various criteria (hashtags, etc.). To
2012 Jan 12
1
parallel computation in plyr 1.7
Dear all, I have a question regarding the possibility of parallel computation in plyr version 1.7. The help files of the following functions mention the argument '.parallel': ddply, aaply, llply, daply, adply, dlply, alply, ldply, laply However, the help files of the following functions do not mention this argument: ?d_ply, ?aply, ?lply Is it because parallel computation is not
2011 Jan 06
0
Problem with package twitteR and converting S4 obj to data frame
Hi, I wrote a simple script to retrieve an n number of followers for a given user in Twitter. I used a sample of n=10 to test my script and worked perfectly but once I started to changes n I started to get the following error: Error in list_to_dataframe(res, attr(.data, "split_labels")) : Results do not have equal lengths I have no clue why works fine with n=10 but for higher
2011 Jan 04
0
plyr 1.4
# plyr plyr is a set of tools for a common set of problems: you need to __split__ up a big data structure into homogeneous pieces, __apply__ a function to each piece and then __combine__ all the results back together. For example, you might want to: * fit the same model each patient subsets of a data frame * quickly calculate summary statistics for each group * perform group-wise
2011 Jan 04
0
plyr 1.4
# plyr plyr is a set of tools for a common set of problems: you need to __split__ up a big data structure into homogeneous pieces, __apply__ a function to each piece and then __combine__ all the results back together. For example, you might want to: * fit the same model each patient subsets of a data frame * quickly calculate summary statistics for each group * perform group-wise
2012 Jun 19
1
Possible bug when using encomptest
Hello R-Help, ----------------------------------------------------------------------------------------------------------------------------------------- Issues (there are 2): 1) Possible bug when using lmtest::encomptest() with a linear model created using nlme::lmList() 2) Possible modification to lmtest::encomptest() to fix confusing fail when models provided are, in fact, nested. I have