search for: col6

Displaying 19 results from an estimated 19 matches for "col6".

Did you mean: col
2006 Dec 14
5
Better way to change the name of a column in a dataframe?
Hello R users -- If I have a dataframe such as the following, named "frame" with the columns intended to be named col1 through col6, > frame col1 col2 cmlo3 col4 col5 col6 [1,] 3 10 2 6 5 7 [2,] 6 8 4 10 7 1 [3,] 7 5 1 3 1 8 [4,] 10 6 5 4 9 2 and I want to correct or otherwise change the name of one of the columns, I can do so with...
2012 Oct 18
4
speeding read.table
...ing a 1 GB file into R using read.table. The file consists of 100 tables, each of which is headed by two lines of characters. The first of these lines is: TABLE NO. 1 The second is a list of column headers. For example: TABLE NO. 1 COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10 COL11 COL12 1.0010E+05 0.0000E+00 1.0000E+00 1.0000E+03 -1.0000E+00 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0010E+05 1.0001E+01 1.0000E+00 1.0000E+03 -1.0000E+00 1.0000E+00 2.2737E...
2005 Mar 23
2
replace values in a matrix subject to boolean condition
Hi everybody! I am sorry to bother you with a question so simple but I think there might be a better solution: I have a matrix of size 360x501 where I want to check the value of each 5th column of each row and replace it (and the 6th, 7th, 8th column) by zero if the value is less than 1000. I have written a double loop to do that but that requires a lot of time. Is there a faster way to
2013 Jan 03
5
splitting matrices
Dear useRs, i want to split a matrix having 1116rows and 12 columns. i want to split that matrix into 36 small matrices each having 12 columns and 31 rows. The big matrix should be splitted row wise. which means that the first small matrix should copy values which are in first 31 rows and 12 columns of the big matrix. similarly 2nd small matrix should contain values from 32nd to 63rd row of the
2006 May 15
1
what's wrong with my "gls"? it does not allocate memory... even for the simplest AR1 model...
> myfit1 <- gls(col1 ~ col2+col3+col4+col5+col6-1, data=data2, corr=corAR1( 0.3202), method='ML') Error: cannot allocate vector of size 199712 Kb if I get rid of the "corr=corAR1(0.3202)" option, it works okay... can anybody help me? thanks a lot! [[alternative HTML version deleted]]
2005 May 02
4
"apply" question
...to calculate (1) the number of values in each row of columns 6-10 that were NA??s (2) the sum of all values on columns 1-5 for which there were no missing values in the corresponding cells of columns 6-10. Example: (let??s call the data frame "data") Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 1 2 5 2 3 NA 5 NA 1 4 3 1 4 5 2 6 NA 4 NA 1 The result would then be (for the first row) (1) "There were 2 NA??s in columns 6-10." (2) The mean of Columns 1-5 was 2+2+3=7&qu...
2011 Aug 25
2
replicate lines of data frame
...d then later change values in the first 2 columns. I am trying to figure out how to accomplish this. I think that I need to use rep(my.df, each=6) but it does not quite work. This is the sample data frame "col1" "col2" "col3" "col4" "col5" "col6" "col7" foo bar 1 blah blah blah blah foo bar 2 blah blah blah blah foo bar 3 blah blah blah blah ...... ...... I need to change it into this: "col1" "col2" "col3" "col4" "c...
2013 Jan 02
4
list of matrices
dear useRs, i have a list containing 16 matrices. i want to calculate the column mean of each of them. i tried >sr <- lapply(s,function(x) colMeans(x, na.rm=TRUE)) but i am getting the following error >Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric can it be done in any other way? and why i am getting this error?? thanks in advance.. elisa [[alternative
2016 Dec 20
2
colnames for data.frame could be greatly improved
...) cat("GB =", round(sum(gc()[,2])/1024, 3), "\n") #GB = 0.397 colnames(DF) = NULL system.time(nm1<-colnames(DF, FALSE)) # user system elapsed # 22.158 0.299 22.498 print(nm1) #[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" ### restart R colnames <- function (x, do.NULL = TRUE, prefix = "col") { if (is.data.frame(x)) { nm <- names(x) if (do.NULL || !is.null(nm)) return(nm) else return(paste0(p...
2012 Nov 23
6
Summary statistics for matrix columns
Hi, is there a way I can calculate a summary statistics for a columns matrix let say we have this matrix x <- matrix(sample(1:8000),nrow=100) colnames(x)<- paste("Col",1:ncol(x),sep="") if I used summary summary(x) i get the output for each column but I need the output to be in matrix with rownames and all the columns beside it this how I want it
2012 Feb 15
1
neuralnet problem
...l <- read.table('in.dat') colnames(All) <- paste('col',1:ncol(All),sep='') # Val = target values, matrix of n rows X 3 columns Val <- read.table('target.dat') # create dataframe dt <- data.frame(Val,All) nn <- neuralnet(Val ~ col1+col2+col3+col4+col5+col6+col7+col8,data=dt) Is there someone kind enough to correct my code ? Many many thanks in advance !! Luc ---------------------------------------------------------------- Dr. Luc Moulinier, Laboratoire de Biologie et G?nomique Int?gratives IGBMC 1, rue Laurent Fries 67 404 ILLKIRCH Cedex Phon...
2016 Dec 27
0
colnames for data.frame could be greatly improved
...c()[,2])/1024, 3), "\n") > #GB = 0.397 > colnames(DF) = NULL > system.time(nm1<-colnames(DF, FALSE)) > # user system elapsed > # 22.158 0.299 22.498 > print(nm1) > #[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" > > ### restart R > > colnames <- function (x, do.NULL = TRUE, prefix = "col") > { > if (is.data.frame(x)) { > nm <- names(x) > if (do.NULL || !is.null(nm)) > return(n...
2009 Nov 05
1
Set colors in a PCA plot based on a gradient vector
...uot;) > text(PC$x[,1],PC$x[,2], labels=cutree(hcl,8), col=cutree(hcl,8)) # Change this, but how??? > > col1=rgb(0.164,0.043,0.850) # Set the colors > col2=rgb(0.150,0.306,1.000) > col3=rgb(0.250,0.630,1.000) > col4=rgb(0.450,0.853,1.000) > col5=rgb(0.670,0.973,1.000) > col6=rgb(0.880,1.000,1.000) > col7=rgb(1.000,1.000,0.750) > col8=rgb(1.000,0.880,0.600) > col9=rgb(1.000,0.679,0.450) > col10=rgb(0.970,0.430,0.370) > col11=rgb(0.850,0.150,0.196) > col12=rgb(0.650,0.000,0.130) > colTemperature=c(col1,col2,col3,col4,col5,col6,col7,col8,col9,col10,co...
2006 Mar 28
1
weights in glm (PR#8720)
...NA Row9 -0.14976 NA NA NA Row10 -0.01267 NA NA NA Col2 0.69283 NA NA NA Col3 0.62603 NA NA NA Col4 0.27695 NA NA NA Col5 0.06056 NA NA NA Col6 -0.19582 NA NA NA Col7 -0.83044 NA NA NA Col8 -1.27914 NA NA NA Col9 -1.93235 NA NA NA Col10 -2.49709 NA NA NA When I omited 'weights=w' above table was filled i...
2006 Nov 30
4
Quicker way of combining vectors into a data.frame
Hi, In a function, I compute 10 (un-named) vectors of reasonable length (4471 in the particular example I have to hand) that I want to combine into a data frame object, that the function will return. This is very slow, so *I'm* doing something wrong if I want it to be quick and efficient, though I'm not sure what the best way to do this would be. I know it is the combining into data
2012 Jul 27
1
overlaying a set of 'grouping' lines on a plot from image()
...;216", "86", "79", "88", "128", "29", "218", "263", "329", "123", "3", "121"), c("Col1", "Col2", "Col3", "Col4", "Col5", "Col6" ))) cols <- c("#000000", "#190000", "#330000", "#4C0000", "#660000", "#7F0000", "#990000", "#B20000", "#CC0000", "#E50000", "#FF0000", "#00FF00", "#00AA00"...
2004 Apr 02
1
convert excell file to text with RODBC package
...) Don't read the last row of the table excell 2) Don' t take the hours My excell file call prueba4.xls and have the following rows: where prueba4.xls was make in excell (office xp) and have one spreadsheet call "Hoja1", you see each rows of she: D??a Hora col1 col2 col3 col4 col5 col6 col7 col8 15/12/2003 12:14:59 217 2760 8,2 35 79,6 86,4 15/12/2003 12:15:00 217 2764 8,2 35 79,6 86,4 15/12/2003 12:15:01 217 2758 8,3 35 79,6 86,4 15/12/2003 12:15:02 217 2760 8,3 35 79,6 86,4 15/12/2003 12:15:03 217 2755 8,3 35 79,6 86,4 15/12/2003 12:15:04 217 2766 8,3 35 79,6 86,4 15/12/2003 12...
2004 Apr 03
1
Re: R-help Digest, Vol 14, Issue 3
...;2) Don' t take the hours See below >My excell file call prueba4.xls and have the following rows: >where prueba4.xls was make in excell (office xp) and have one spreadsheet >call "Hoja1", you see each rows of she: >D??a Hora col1 col2 col3 col4 col5 col6 col7 col8 >15/12/2003 12:14:59 217 2760 8,2 35 79,6 86,4 >15/12/2003 12:15:00 217 2764 8,2 35 79,6 86,4 >15/12/2003 12:15:01 217 2758 8,3 35 79,6 86,4 >15/12/2003 12:15:02 217...
2005 Apr 14
4
data manipulation
Hello, my question is about the data handling. I have a data set that is lined as: 4 1 17 1 1 -5.1536 -0.1668 -2.3412 -0.5062 0.9621 0.3640 0.3678 -0.5081 -0.2227 0.8142 -0.0389 -0.0445 -0.0578 -0.1175 -0.1232 0.8673 -0.1033 -0.0796 -0.0341 -0.1716 -0.1801 -0.7014 0.6578 0.5611 4 1 17 2 1 -5.1536 -0.1668 -2.3412 -0.5062 0.9621 0.3640 0.3678 -0.5081 -0.2227 0.8142 -0.0389 -0.0445