search for: colname1

Displaying 7 results from an estimated 7 matches for "colname1".

Did you mean: colnames
2009 Dec 31
3
How x[, 'colname1'] is implemented?
I don't see where describes the implementation of '[]'. For example, if x is a matrix or a data.frame, how the lookup of 'colname1' is x[, 'colname1'] executed. Does R perform a lookup in the a hash of the colnames? Is the reference O(1) or O(n), where n is the second dim of x?
2009 Dec 31
3
How x[, 'colname1'] is implemented?
I don't see where describes the implementation of '[]'. For example, if x is a matrix or a data.frame, how the lookup of 'colname1' is x[, 'colname1'] executed. Does R perform a lookup in the a hash of the colnames? Is the reference O(1) or O(n), where n is the second dim of x?
2011 Nov 26
2
simplify source code
Hi I would like to shorten mod1 <- nls(ColName2 ~ ColName1, data = table, ...) mod2 <- nls(ColName3 ~ ColName1, data = table, ...) mod3 <- nls(ColName4 ~ ColName1, data = table, ...) ... is there something like cols = c(ColName2,ColName3,ColName4,...) for i in ... mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) I am looking forwar...
2002 Nov 04
3
write table and dinnames
I would write in tab-text file a table like this one: TAB colname1 TAB colname2 TAB TAB... colnameN rowname1 # # # rowname2 # # # rownameM # # # then I wrote something like: mymatrix <- matrix(nrow=M,ncol=N,byrow=T) rownames(mymatrix) <- chvector1 colnames(mymatrix) <- chvec...
2007 Jun 06
2
lookup in CSV recipe
...han a final version - it''s also only been tested for 5mins. Even so I thought it might be useful. I thought about adding it to the wiki, but thought I should check here first. # lookup items from a CSV file # v0.1 - 2007/06/06 # Adrian Bridgett, Opsera Ltd. # file in the format of: # colname1, colname2, colname3,... (must be first line) # key1, value2, value3,... # key2, value4, value5 # # lookup_csv(filename,key1,colname3) will then return value3 # # TODO: # proper CSV parsing (e.g. quoting) # regexp on the value? # return a supplied default if row not found? # add Excel and Openoffic...
2008 Jun 21
1
passing arguments to a function problem
Dear R-users, is there some way how to pass various colnames to the following code for sorting data.frames? mydf.ordered<-with(mydf, mydf[order(colname1,colname2, colnameX, decreasing = TRUE), ]) I was trying something like Afunction<-function (mydf,colnames,decreasing=T){ mydf.ordered<-with(mydf, mydf[order(colnames, decreasing = decreasing), ]) } but it didnt work please help thank you Jiri Voller [[alternative HTML version...
2006 May 17
0
variable colnames
...:32 ??: r-help at stat.math.ethz.ch Cc?: COMTE Guillaume Objet?: Re: [R] variable row names Hi I was confused by your example, too and still am a little bit confused, so please excuse me if my example does not answer your question: You have a data.frame "dat" > dat <- data.frame(colname1 = 1:4, colname2 = 5:8) You have a vector with the colnames of "dat" > namen <- colnames(dat) You want to acess on the values in dat bu using the vector "namen" > for (i in namen) > print(dat[,i]) or > for (i in 1:length(namen)) > print(dat[,namen[i]])...