search for: testcol

Displaying 2 results from an estimated 2 matches for "testcol".

2007 Jan 04
5
color of opposite sign values in filled.contour
Dear R-helpers, I'm plotting geophysical data in the form of contours using "filled.contour". The display would be much more effective if the areas with negative values could be color coded by -- say -- "cold colors" in the range of blue to green, and conversely the areas with positive values got plotted with "warm colors", from yellow to red. Right now if I use
2010 Jul 28
0
Fwd: How to point a column of dataframe by a "character"
...>> Firstly, >> for (i in 1:(dim(data)[2])){ >> model<-lm(Y~data[,i]) > You could try instead: model1 <- lm(Y ~ . , data=data[ , i, drop=FALSE]) I added the drop=FALSE to prevent a single column from being converted to a nameless vector. > testdf <- data.frame(testcol=letters[1:10], stringsAsFactors=FALSE) > testdf[,1] [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" > testdf[,1, drop=FALSE] testcol 1 a 2 b 3 c 4 d 5 e 6...