search for: jingjiangyan

Displaying 5 results from an estimated 5 matches for "jingjiangyan".

2006 Dec 27
3
how to transform string to variable name in a fuction?
there is a data frame, like this: > df aa bb 1 a 20.27802 2 b 22.10664 3 c 21.33470 4 a 22.32898 5 b 19.73760 6 c 20.38979 .....(suppressed) what I want to do is to copy the data frame's rows into different data frames according to the levels of 'aa' column, > df.a <- df[df[,1]=='a',] ; df.b <- df[df[,1]=='b',] ; ....
2006 Dec 27
0
R-help Digest, Vol 46, Issue 27
On Wednesday 27 December 2006 06:00, r-help-request at stat.math.ethz.ch wrote: > jingjiangyan I agree, you can use 'assign'. To be more explicit, you could use the following function. jingjiangyan <- function(formula, data) { m <- match.call() "%,%" <- function(x,y)paste(x,y,sep="") d.nm <- as.character(m$data) y.nm <- as.character(for...
2006 Dec 24
1
how to do the "double substitute" in a loop?
Hi, people I am just new to R, when writing my loop functions, I meet a problem. There are some data frames, their names is randomized, ( e.g. a1,b3,c7, etc), what should I write it when I want to see them printed together in a loop function? I have tried : > for ( df in 'a1','b3','c7') { + print(print(df)) + } the
2009 Jan 22
1
Is there any function can be used to compare two probit models made from same data?
hi, people How can we compare two probit models brought out from the same data? Let me use the example used in "An Introduction to R". "Consider a small, artificial example, from Silvey (1970). On the Aegean island of Kalythos the male inhabitants suffer from a congenital eye disease, the effects of which become more marked with increasing age. Samples of islander males
2007 Jul 09
1
why function 'sum' within 'aggregate' need an 'index'?
Hi, people. I am using R-2.5.0 now, when tried the function aggregate with sum, it showed an error as following: > a <- gl(3,10) > b <- rnorm(30) > aggregate(b,list(a),sum) # here is the error message, it complained that an error in FUN(X[[1L]], missing "INDEX", and no defaults value. but the tapply function will be okay. > tapply(b,list(a),sum) 1 2