search for: newmeans

Displaying 4 results from an estimated 4 matches for "newmeans".

Did you mean: newmean
2011 Sep 01
2
R Help finding Mean
bob<-read.csv('shi.csv', header=T) newmean<-matrix(0, test, dim(bob)[2]-6);a<-0; for (i in c(4,8:(dim(bob)[2]))) {a<-a+1;newmean[,a]<-tapply(bob[,i], bob$Exam, mean)} colnames(newmean)<-colnames(bob)[c(4,8:(dim(bob)[2]))] Could anyone please help me what does the above code does ... I want to find mean ... but would like to know what exactly is the above code doing.
2007 Mar 12
1
How to avoid a for-loop?
Hi all, as I am trying to move slowly from just "working" to "good" code, I'd like to ask if there's a smarter way than using a for-loop in tasks like the example below. I need to obtain the extrema of the cumulated sum of a detrended time series. The following code is currently used, please have a look at the comments for my questions and remarks: system.time({ X
2010 Aug 06
2
Pausing script to allow user input from keyboard.
Hi all, I have written a simple R script to help me analyze a large data set. I would like to have the script pause to allow the user to input a character string that is subsequently used as a filename when saving tables. I have tried to use the "readline" command - this seems to work fine when entering commands one by one, but when I copy and paste the entire script into R,
2012 Jun 20
2
Using object as literal value in list vector
...ector of strings to name a number of list elements. For instance #Create vector of strings Et<- c("ACC","RTL","WHL") MeanValues_ <- list("ACC" = 1000, "RTL" = 2000, "WHL" = 3000) #Iterate through each element of vector NewMeans_ <- list() for(et in Et){ NewMeans_ <- c(NewMeans_,list(et = unlist(MeanValues_[et]) * .80 )) } Returns > NewMeans_ $et ACC 800 $et RTL 1600 $et WHL 2400 But I want 'et' to be the object value of et, so it would be $ACC, $RTL, and $WHL. I realize there may be anot...