search for: wwwhsd

Displaying 20 results from an estimated 39 matches for "wwwhsd".

2007 Oct 22
median value dataframe coming from multiple dataframes
Hi all, I am not a skillful R programmer and has I am handling with large dataframes (about 30000 x 300) I am in need of an efficient function. I have 4 dataframes with the same dimension. I need to generate other dataframe with the some dimension than the others where in each position it has the median value of the 4 values in the same position coming from the 4 dataframes. Grateful by your
2009 Jan 06
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang
2010 Aug 05
Extracting future and past workday dates
Hello everyone I need to extract a vector of (t-3) to (t+3) dates, only working days. How can I do that? For today I need a vector: 10.08.210 09.08.2010 06.08.2010 05.08.2010 04.08.2010 03.08.2010 02.08.2010 Regards, Sergey -- Kniven sk?rpes bara mot stenen.
2009 Jul 08
RDCOMClient: how to close Excel process?
Hi, I?m using R package RDCOMClient ( to retrieve data from MS Excel workbook. I?m using the code below to count the number of sheets in the workbook and then loop the data from sheets in to a list. ############# R code ################### library(gdata) library(RDCOMClient) xl <- COMCreate("Excel.Application") sh <-
2008 Oct 18
Select only cases with negative values
Hello, I was wondering if there was a way to only select cases my from data frame that contained a negative value? > c<-c(1,2,3,4,5,6,7,8,9,10) > d<- c(-1,2,-3,-4,5,6,-7,8,-9,10) > f <- cbind(c,d) > dat <-data.frame(f) > dat.lm <-lm(c~d) If I wanted to only use the rows that had a negative value in column d for my regression, how could I make that selection?
2010 Sep 27
scientific vs. fixed notation in xyplot()
Hi I am using xyplot() to plot on the log scale by using scale=list(log=T) argument. For example: xyplot(1:10~1:10, scales=list(log=T)) But the axis labels are printed as scientific notation (10^0.0, etc), instead of fixed notation. How can I change that to fixed notation? options(scipen=4) doesn't work on xyplot() Thanks John
2010 Mar 22
Factors attribute?
I noticed that when I fit a linear model using 'lm' there is an attribute called "factors" that is added to the "term". It doesn't seem to appear for 'model.matrix', just 'lm'. I have been unable to find where it gets constructed or what it means? It looks like a two dimensional array that I may be able to use so I would just like to get some
2011 Apr 07
Regrouping data
Dear R forum I have just started my venture with R. While I am trying to learn R through the tutorials, I think the current problem I need to address to is beyond my knowledge about R. I have a dataframe as defined below - rat_dat = data.frame(name = c("A", "A", "A", "B", "B", "B", "C", "C", "C",
2010 Nov 17
reduce print accuracy
Hello everyone. Consider the following number below:  0.9333333333333333 0.9333333333333333 0.0666666666667 Is it possible to print them with less digits like 0.93 0.93 0.06 (but without losing the R's accuracy). I would like to thank you in advance Best Regards Alex [[alternative HTML version deleted]]
2009 Jul 07
error: no such index at level 2
Hi, I am confused about how to select elements from a list. I'm trying to select all rows of a table 'crossRsorted' such that the mean of a related vector is > 0. The related vector is accessible as a list element l[[i]] where i is the row index. I thought this would work: > crossRsorted[mean(q[[ crossRsorted[,1] ]], na.rm = TRUE) > 0, ] Error in q[[crossRsorted[, 1]]] :
2011 Mar 28
Ordering data.frame based on class
Dear R helpers Suppose I have a data.frame as given below - my_dat = data.frame(class = c("XYZ", "XYZ", "XYZ", "XYZ", "XYZ","ABC", "ABC", "ABC", "ABC", "ABC" ),  var1 = c(20, 14, 89, 81, 17, 44, 36, 41, 11, 36), var2 = c(1001, 250, 456, 740, 380, 641, 111, 209, 830, 920)) > my_dat    class
2009 Sep 05
Anova over a list of models
I have a list object, in which I have stored n lme4-models. For example: library(lme4); myModels <- list(); myModels[1] <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) myModels[2] <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy) Now I would like to perform an anova over all models in the list. However, the anova function requires that every model is inserted
2010 Jan 11
R for windows 64 bit
Dear all, do you know if there is any particular version of R to implement with windows 64 bit, in such a way to increase the amount of memory it can use? How should I increase the memory, and more importantly to set a higher max vector size? It still stops me saying "Could not allocate vector of size 145" thanks to all alessia
2008 Apr 16
What objects will save.image saves ? And how to specify objects to be saved..
Hi, I have a R script that loads an image, does some operations, then save to the again. Suppose I have done some computation before loading the R script, will all the objects before the R script execution be saved to ? If yes, how can I specify save.image to save only those objects created in the R script ? Thanks Stanley [[alternative HTML version deleted]]
2008 May 10
substitute in graphics - Uwe's help desk
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <>
2008 Sep 27
quantile / centile
I'm wondering if there is a simple way to assign a quantile to a vector in a data frame, much like one could in Stata using centile. Let's say I want 100 slices in my assignation. I can easily see what the limits of each slice by using quantile: quantile(my.df$my.var, probs=seq(0, 1, 0.01)) But how do I assign the appropriate value to each row/record in my data frame? Clearly the
2009 Aug 10
strsplit a matrix
Dear all, I am trying to split a matrix into 2 as efficiently as possible. It is a character matrix: 1 2 3 1 "2-271" "2-367" "1-79" 2 "2-282" "2-378" "1-90" 3 "2-281" "2-377" "1-89" I want to make 2 matrices from this, as succinctly and efficiently as possible. I've tried such
2010 May 27
how to extract the 1st field from a vector of strings
I have the following vector of strings (shown only the first 3 elements) > desc[1:3] [1] "hsa-let-7a MIMAT0000062 Homo sapiens let-7a" [2] "hsa-let-7a* MIMAT0004481 Homo sapiens let-7a*" [3] "hsa-let-7a-2* MIMAT0010195 Homo sapiens let-7a-2*" > is.vector(desc) [1] TRUE > A <- unlist(strsplit(desc[1:3], " ")) > A [1]
2008 Apr 16
transposition problem
Hi use Rs, I have a csv file: "1989-90","1990-91" Barley,23,34 Oats,15,16 Which I want to turn into: year, Barley, Oats 1 "1989-90", 23, 15 2 "1990-91",34,16 Transpose doesn't quite do it, is there a standard way? Cheers, Geoff Russell
2010 Apr 05
Adding a prefix to all values in a col in a data.frame
Hi All I am looking for a way to prefix a constant value to all the rows in column in a data frame. Eg. V1 2 3 4 5 I want to make it like this V1 number2 number3 number4 number5 Thanks! -Abhi [[alternative HTML version deleted]]