similar to: Quick q. on lists

Displaying 20 results from an estimated 10000 matches similar to: "Quick q. on lists"

2009 Sep 02
2
Average over data sets
Hello, I have a number of files output1.dat, output2.dat, ... , output20.dat, each of which monitors several variables over a fixed number of timepoints. From this I want to create a data frame which contains the mean value between all files, for each timepoint and each variable. The code below works, but it seems like I should be able to do the second part without a for loop. I played
2009 Dec 22
2
Nested For loops
Dear R experts, Might be very simple question to ask but would be insightful. As the same story of nested "for loops". following is the code that I am using to get the autocorrelation function of the sample data. I have tried to get rid of for loops but since I am touching R after such a long time that I need to practice more but I need help to revive my skills. I know that apply() or
2010 Apr 19
2
ecdf
Hello, I'd like to plot an empirical cumulative distribution function, except instead of the fraction of values < x, I'd like the fraction of values > x. I think this can be done using the ecdf function in {Hmisc}. I installed the package and loaded it. However, when following the example given in the documentation, I get an error: x <- rnorm(100) ecdf(x,what='1-F')
2009 Sep 25
3
Problem on plotting TS using GGPLOT
Hi, I have following codes : library(zoo); library(ggplot2); library(plyr) dat <- rnorm(306); vv <- letters[1:6]; dat1 <- data.frame(dat, vv) dat2 = zooreg(rnorm(51), as.yearmon(as.Date("2000-01-01")), frequency=12) ggplot(dat1) + geom_line(aes(y=dat, x=index(dat2), colour=vv), group=vv, size = 1.3) However I got error while plotting them :
2010 Apr 29
5
reduce size of pdf
is there a way to reduce the size of pdf files in R: ? compression? lower dpi ? or some other option?
2009 Aug 13
4
un run run...
Hi All, I am running an Rscript with a bunch of algorithms that are UNSTABLE under some parameter settings. At a certain point one of them sends error massage and my whole run STOPS! What I would like is to save the error massage in some file or variable and carry on to the next command line without stopping this run... Any help or ideas would be welcome, please, with a concrete example (not
2009 Mar 11
3
Mixed models fixed effects
Dear All, This may sound like a dumb question but I am trying to use a mixed model to determine the predictors of bat activity along hedges within 8 sites. So my response is continuous (bat passes) my predictors fixed effects are continuous (height metres), width (metres) etc and the random effect is site - can you tell me if the fixed effects can be continuous as all the examples I have
2010 Aug 30
1
compare three values
Hi, I've three values. What is the best method to choice the lowest values with an if function? example: a = 3 b = 1 c = 5 if (lowest(a,b,c) is a) {........} if (lowest(a,b,c) is b) {........} if (lowest(a,b,c) is c) {........} Thanks, Alfredo
2010 Feb 09
2
step and glmer
Is it possible to use the step() function with a glmer() as an object? I obtain the following error message when I try to do it: "Error in x$terms : $ operator not defined for this S4 class". I perform the glmer correctly but I can't do the step. Thank you so much. -- View this message in context: http://n4.nabble.com/step-and-glmer-tp1474390p1474390.html Sent from the R help
2010 Sep 06
2
rbind() overwriting data.frame()
Hi, first off, I wanna ask how do I declare a data.frame of 0 rows and n columns? Coming to my problem, I have a data.frame of 22 columns by dynamic rows which I insert using rbind. The total number of rows could go upto 2,00,000. The problem is that after about 800 or 900 get inserted rbind starts overwriting the data.frame and I end up with a total of 800-900 rows. What is up with that? The
2009 Feb 11
2
Label bars in a faceted bar plot in ggplot2
Hi List, I am running R 2.8.0 on a Windows XP machine, running ggplot2 version 0.8.1 I want to label the bars in a faceted grid barplot. Reproducible R code is given below: #### reproducible facet barplot ##### library(ggplot2) # Dataset from which to create the barplot ml <- rep(1:10,2) vals <- rnorm(20,mean = 10, sd=1) type <- c(rep("MAPE",10),rep("AIC",10))
2008 Aug 07
3
Bug in rnorm? (PR#12016)
Full_Name: Paul Eckermann Version: 2.7.1 OS: Windows XP Service Pack 2 Submission from: (NULL) (129.127.183.12) This is the first time I have submitted a bug report, so apologies if I have not followed the correct protocol. If I enter length(rnorm(100*.29)) it returns 28 rather than 29. y<-(1:100)/100 z<-sapply(y,function(x) length(rnorm(x*100))) z!=100*y indicates that it has
2009 Jul 07
6
Uncorrelated random vectors
Hello, is it possible to create two uncorrelated random vectors for a given distribution. In fact, I would like to have something like the function "rnorm" or "rlogis" with the extra property that they are uncorrelated. Thanks for your help, Luba [[alternative HTML version deleted]]
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs, I want to plot the following barplot with lines instead of bars. Is there a way? data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48))) d <- t(data[,2:4]) barplot(d, beside=TRUE) Regards, Rafael. ____________________________________________________________________________________ [[elided Yahoo
2010 Sep 22
1
Ordinal mixed model
Hello, I am trying to build a generalised linear mixed model.? My dependent variable is ordinal.? I have a random factor (7 individuals), and a repeated measure where the dependent variable was measured three times for each of four attempts (so the repeats are nested).? I also have a few covariates.? I am a complete novice in R, being used to using SPSS.? SPSS lets me build an ordinal model
2008 Dec 15
2
how to merge list of dataframes?
Dear all: I have a list of dataframes like this, i try to merge this lists of dataframes into one single dataframe, and keep ther column names as usual, how can i do this? i try lapply(aa,rbind), but it dose not work. Best regard! > summary(aa) Length Class Mode [1,] 3 data.frame list [2,] 3 data.frame list [3,] 3 data.frame list [4,] 3 data.frame
2010 May 27
1
adding column to data frame conditionally
Dear all and thanks in advance for helping me with a rather stupid question: I imported a data set ("freqg") into R consisting of 14 variables. Now a want to compute a variable and add it in an additional column to my data frame. The value of this new variable ("condition") depends on the values of two other variables ("mat" and "flank") already
2010 Jun 09
1
specifying plot symbol sizes in qplot or ggplot2
Hi. first things first ... thanks for ggplot2. Now my question. I'm using qplot to generate a plot as follows where X,Y,Z, A are columns in a dataframe. qplot(X, Y, data=XYDATA, color=Z, geom=c("point"), size=A) This works as expected. Factor A has three levels so there are three sizes of the point plot symbol. I understand that the factor levels are mapped to symbol sizes.
2010 Jan 15
1
Best method
Hi, I would like to ask for advice about best statistics method for my problem. I was done questionnaire about headache. My data are: Y - frequency of symptoms occur - times per month in range <0..30> (where 30 is daily and zero for never) and independent variables: X1 - sex - category {M,F} X2 - age - linear value X3 - type of work {administrative, manual, ...} ... Which model is
2010 Jul 29
1
precision of minus operation and if statments
Hi Everyone, as part of a larger script, I need to insert the result of a simple minus operation into an if statement. I have noticed that the precision that appear on the screen is not the precision in which R stores the result of the minus operation, and that this change alters the result of the if statement. For example, when running this simple script:   > a=0.90 > b=0.95 >