similar to: Extracting Numeric Columns from Data Fram

Displaying 20 results from an estimated 500 matches similar to: "Extracting Numeric Columns from Data Fram"

2013 Feb 21
3
Ask for help: find corresponding elements between matrix
Dear R experts, I have two matrix (seq & mat) & I want to retrieve in a new matrix all the numbers from mat that =1 (corresponding to the same row/ column position) in seq, or all the numbers in mat that =-1 in seq. - Replace all the numbers with NA if it's not 1/-1 in seq. There are some "NA"s in seq. seq=matrix(c(1,-1,0,1,1,-1,0,0,-1,1,1,NA),3,4)
2011 Jul 12
3
Reorganize data fram
Hi, I have a data frame of about 700 000 rows which look something like this: Date Temperature Category 2007102 16 A 2007102 17 B 2007102 18 C but need it to be: Date TemperatureA TemperatureB TemperatureC 2007102 16 17 18 Any suggestions? /Angelica -- View this message
2008 Jul 02
2
Accessing a field in a data fram
raw <- read.csv(file=filename, head=TRUE,sep=",") I've read in a csv file, and I'm looking to access a column whose name is held in a string. For example, I want to access raw$one or raw$two, but this will depending on the string. Let's say that the string is decision<-"one". How would I access raw$one? The following doesn't work:
2006 Mar 16
3
Did I use "step" function correctly? (Is R's step() function reliable?)
Hi all, I put up an exhaustive model to use R's "step" function: ------------------------ mygam=gam(col1 ~ 1 + col2 + col3 + col4 + col2 ^ 2 + col3 ^ 2 + col4 ^ 2 + col2 ^ 3 + col3 ^ 3 + col4 ^ 3 + s(col2, 1) + s(col3, 1) + s(col4, 1) + s(col2, 2) + s(col3, 2) + s(col4, 2) + s(col2, 3) + s(col3, 3) + s(col4, 3) + s(col2, 4) + s(col3, 4) + s(col4, 4) + s(col2, 5) + s(col3,
2002 Sep 03
1
about fram buffer & twm cursor!!
Dear all, I have two questions under syslinux. First. When I start the system with syslinux, some messages display on the screen and want me to enter display mode to show or enter "scan" the scan the display resolution. If I made anything wrong? Second. I used the same kernel image as above and different cpu care(SBC), It can work perfectly
2005 Sep 16
1
De-data.fram-ize?
Dear useRs, Is there any more elegant way to convert dataframe to a vector of all its values than as.vector(as.matrix(x)) ? I did not have to do such conversion yet, so I am not sure... (of course as.vector() alone does not work). Regards, -- Lukasz Komsta Department of Medicinal Chemistry Medical University of Lublin Jaczewskiego 4, 20-090 Lublin, Poland Fax +48 81 7425165
2007 May 11
1
conditional across frames of a data fram
I'm a newbie, so please forgive me: I have a data frame that includes two long columns of x and y coordinate values thusly: ... ... ... x y ... ... ... ... ... 115 127 ... ... ... ... ... 120 129 ... ... ... ... ... 0 0 ... ... ... ... ... 135 162 .... ... ect... i need to ask R tell me how many x-y pairs contain coords that are
2004 Jul 05
2
More difficulties in getting data into R
In order to get around the problems of my posting a few minutes ago, I thought: $ awk -F\| '(NR > 2) {print $2}' cmie_firm_data.text > col2 $ awk -F\| '(NR > 2) {print $4}' cmie_firm_data.text > col4 $ paste col2 col4 | head -2 -510.45 -510.27 60700 101900 $ paste col2 col4 | tail -2 28648.12 31617.02 491014.77 494308.52 $ wc -l col2 col4 89323 col2
2017 Jun 21
4
selecting dataframe columns based on substring of col name(s)
Suppose I have the following sort of dataframe, where each column name has a common structure: prefix, followed by a number (for this example, col1, col2, col3 and col4): d = data.frame( col1=runif(10), col2=runif(10), col3=runif(10),col4=runif(10)) What I haven't been able to suss out is how to efficiently 'extract/manipulate/play with' columns from the data frame, making use
2010 Jul 24
2
union data in column
Is there any function/way to merge/unite the following data GENEID col1 col2 col3 col4 G234064 1 0 0 0 G234064 1 0 0 0 G234064 1 0 0 0 G234064 0 1
2009 Oct 02
3
help with regexp mass substitution
Hello * i have to rename a lot of variables, and, given that they have regular name constructs, I would like to use regexps. Here's a dump of my head(names(df)) varnames <- c("id.quest", "txt.1.3", "col1.1.3", "col2.1.3", "col3.1.3", "col4.1.3", "col5.1.3", "txt.2.3", "col1.2.3",
2004 Sep 28
4
An index of all possible combinations of variables in a data fram e
Hello list Does anybody know of any way to create an index of all the possible combinations of variables (factors) in a data frame? ie for 3 factors A, B & C we have A B C AB AC BC ABC which equates to columns 1, 2, 3, 1:2, (1,3), 2:3 and 1:3. I realise that a function like model.matrix does this, but how to get the seqence of the index? Any help would be greatly appreciated.
2005 Feb 11
2
Notes on bug reports 3229 and 3242 - as.matrix.data.fram e
> From: Gorjanc Gregor > > ! Look after character ! > > From: Prof Brian Ripley [mailto:ripley@stats.ox.ac.uk] > You too have not give an reproducible example! > ! Yes, I was not able to do it from my data. But bellow is one. It is > ! a stupid one, but it works. The problem is use of as.data.frame in > ! tmp1$L <- as.data.frame(tmp$L). This looks like to produce
2009 Oct 22
2
How to find moving averages within each subgroup of a data frame
Dear all, If I have the following data frame: > set.seed(21) > df1 <- data.frame(col1=c(rep('a',5), rep('b',5), rep('c',5)), col4=rnorm(1:15)) col1 col4 1 a 0.793013171 2 a 0.522251264 3 a 1.746222241 4 a -1.271336123 5 a 2.197389533 6 b 0.433130777 7 b -1.570199630 8 b -0.934905667 9 b 0.063493345 10 b
2010 Mar 22
1
help needed with boxplot
I am new to R, can anyone help with boxplot for a dataset like: file1 col1 col2 col3 col4 col5 050350005 101 56.625 48.318 RED 051010002 106 50.625 46.990 GREEN 051190007 25 65.875 74.545 BLUE 051191002 246 52.875 57.070 RED 220050004 55 70 80.274 BLUE 220150008 75 67.750 62.749 RED 220170001 77 65.750 54.307 GREEN file2 col1 col2 col3 col4 col5 050350005 101 56.625 57 RED 051010002 106 50.625 77
2019 Feb 12
7
Leer un txt a trozos
Estimad en s eRRer en s, Tengo un txt que quiero importar a R. Pero no tiene un formato adecuado para usar cosas normales, como por ejemplo read.csv() El formato es algo así: time 1 col1 col2 col3 col4 dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato dato end time 2 col1 col2 col3 col4 dato dato dato dato dato dato dato dato dato dato dato dato dato
2017 Jun 21
0
selecting dataframe columns based on substring of col name(s)
> On Jun 21, 2017, at 9:11 AM, Evan Cooch <evan.cooch at gmail.com> wrote: > > Suppose I have the following sort of dataframe, where each column name has a common structure: prefix, followed by a number (for this example, col1, col2, col3 and col4): > > d = data.frame( col1=runif(10), col2=runif(10), col3=runif(10),col4=runif(10)) > > What I haven't been able to
2010 Oct 11
2
Split rows depending on time frame
Hi, I have the following data frame, where col2 is a startdate and col3 an enddate COL1 COL2 COL3 A 40462 40482 B 40462 40478 The above timeframe of 3 weeks I would like to splits it in weeks like this COL1 COL2 COL3 COL4 A 40462 40468 1 A 40469 40475 1 A 40476 40482 1 B
2013 Feb 16
8
Unir varias columnas en una sola
Buenas a todos, relato directamente mi problema. Estoy preparando unos datos para ingresarlos en otro programa que requiere una columna de ID y el resto de la información toda seguida sin espacios. El echo es que yo tengo la información separada en columnas, por ejemplo: ID col2 col3 col4 col5 etc. y precisaría dejarla de la siguiente forma: ID col2col3col4col5 etc. Para luego escribir a
2009 Apr 09
5
data.fram zero's
Hi all, A simple question which I don???t seem to be able to solve: I want to make a data.frame of 360 rows and 94228 column with only zero???s without having to type all these zero???s ;-) What is the easiest method? Thanks, Naomi Disclaimer: De informatie opgenomen in dit bericht (en bijlagen) kan vertrouwelijk zijn en is uitsluitend bestemd voor