Displaying 20 results from an estimated 100 matches similar to: "Rearranging a data frame for multiple observations"
2010 Feb 23
1
Matching Problem
Hi,
I have a problem with function match. I might not be using it properly?
I have two character vectors that contain a unique identifier:
gtype_prochi <- ("CAO1524452" "CAO0966182" "CAO9209719" "CAO4436178"
"CAO3761898"
"CAO3529266" "CAO2427148" "CAO8829776" "CAO2517174" "CAO5371418"
2010 Mar 12
7
sqldf not joining all the fields
Dear R users,
I have two data frames that were read from text files as follows:
x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'",
dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA,
nrows = 3864284,
skip = 0, check.names = TRUE,fill=TRUE,
strip.white = TRUE,
2010 Mar 03
1
Subset using partial values
Hi everyone,
I would like to subset a data.frame using partial values.
For example I have the following data.frame:
PROCHI Main_condition
1234 411
1235 4110
1236 4111
1237 I20
1238 I201
1239 I202
Now let's say that I use the Subset function. Ordinarily I would use it as
follows Subset(x, Main_condition=="411"|Main_condition=="4110" etc to get
2010 Sep 06
3
Finding the two most recent dates
Dear R help,
I have the following data frame:
structure(list(prochi = c("ind_1", "ind_1", "ind_1",
"ind_1", "ind_1", "ind_1", "ind_1", "ind_1",
"ind_1", "ind_1"), date_1st_event = structure(c(14784,
14784, 14784, 14784, 14784, 14784, 14784, 14784, 14784, 14784
), class = "Date"),
2011 Mar 09
2
Cleaning date columns
Hi Everyone,
I have the following problem:
data <- structure(list(prochi = c("IND1", "IND1", "IND1",
"IND2", "IND2", "IND2", "IND2", "IND3",
"IND4", "IND5"), date_admission = structure(c(6468,
6470, 7063, 9981, 9983, 14186, 14372, 5129, 9767, 11168), class = "Date")),
.Names =
2010 Mar 15
1
inner join sqldf
Hi,
I have two dataframes that have some common columns. I would like to join
them by the common columns prochi and prescribed_date as there are duplicate
prochis but they will be made unique by date. I tried doing an inner join
but that just duplicated the columns whereas I would like the information
from the test_sql_tsf to fill the NAs in the test_sql_psd common columns.
require(sqldf)
2009 Jul 17
2
Resolution changes sometimes rearranging desktop
Sometimes when I play games that use a resolution different from my normal X display, the windows on my workspace get shifted over toward the upper left. It's an issue that's been happening for a long while and I'm not sure if this is more of a general X issue or something specific to wine. As far back as I remember, it only happens with wine (0.x-0.9, 1.0, 1.1) and I've seen it in
2007 Jun 11
1
Rearranging Capture History Data in R
What code can i use to convert a table like this:
Tag# Date
1 1
2 1
3 1
4 1
2 2
4 2
1 3
2 3
4 4
Into one like this:
Tag 1 2 3 4 #Date header
1 1 0 0 1
2 1 1 1 0
3 1 0 0 0
4 1 1 0 1
Thanks,
Ben Cox
Research Assistant (M.S.)
Montana Cooperative
2007 May 29
2
fullscreen 3D leads to gnome panels rearranging
Hi,
Just wondering if anyone else has seen this behavior?
Today I ran some 3D demos, just for fun (from
http://www.vividimage.enta.net/electrome/) !!!
When the demo ends and gives me back a gnome desktop all my panels icons had
rearranged and ended up at the right hand corner in a tiny clump.
In windowed mode its fine just full screen.
Any ideas? Should I file a bug report or is this
2003 Jan 19
0
Rearranging subtrees and Eisen Cluster
I am attempting to replicate what Cluster 3.0 and Treeview (both by Mike
Eisen) to cluster both microarray genes and arrays does using R with
hclust. I basically utilized the plot.mat function in sma library with
some layout() and hclust().
1. Can I know if some has already written such a function or available
in some package.
2. If not, would appreciate if someone could take the time to test
2003 Feb 05
1
rearranging rows
Dear all,
I am working with a matrix structured as follows
Factor 1 Factor2 ...
Country 1
Country 1
Country 2
Country 2
...
Country N
Country N
and I need to rearrange it according to the following scheme
Factor 1 Factor2 ...
Country 2
Country 2
Country N
Country N
...
Country 1
Country 1
where countries are ordered accordingly to the average
2006 Jun 23
1
rearranging data frame rows
Hi All,
I have two data frames. The first contains data about a number of individuals,
coded in the first column with a name, in an order I find convenient.
The second contains different data about the same indivduals, in a different
order. Both data frame have the individual names in the first column.
I need to reorder the second data frame so the rows are rearranged in the same
manner as
2006 Jun 23
0
R: rearranging data frame rows
Have a look at merge.
Ciao
Vittorio
>----Messaggio originale----
>Da:
f.calboli at imperial.ac.uk
>Data: 23-giu-2006 18.10
>A: "r-help"<r-
help at stat.math.ethz.ch>
>Ogg: [R] rearranging data frame rows
>
>Hi
All,
>
>I have two data frames. The first contains data about a number
of individuals,
>coded in the first column with a name, in an order
2007 Oct 11
2
Rearranging dataset
Hi all, I have a datasei like this :
ID Date Price
aa 01/01/07 12
aa 01/02/07 13
bb 01/01/07 23
bb 01/02/07 12
Now I want to write them in following format :
ID Date Price ID Date Price
aa 01/01/07 12 bb 01/01/07 23
aa 01/02/07 13
2011 Apr 21
1
Rearranging columns with cbind
I'm getting an error that I don't understand when trying to rearrange my data
columns with cbind. My data is in 27 columns, like so:
> data <- read.table("CalledFeatsNimblegen.csv", header=T, sep=",")
> names(data)
[1] "MF_not_mC" "MF_promoter" "MF_genebody"
"FF_not_mC"
[5]
2008 Jul 31
1
Rearranging Data
Hi everyone,
A few days back Jim helped with out, helping me find an automated way of
determining the mean and median of intervals between price changes.
However, a new set of data I have is no longer in the same format.
CDSmod is the file that was used with this code:
x <- read.csv('/cdsmod.csv', as.is=TRUE, check.names=FALSE)
x$Date <- as.Date(x$Date, "%m/%d/%Y")
2009 Jul 13
1
R in rearranging equations
Hi,
can anyone tell me if R can be used to rearrange very complicated equations
in terms of one of the variables?
I have:
dx/dt = a*b*m*y*(1-x)-r*x
and, having set:
dy/dx = 0,
need to rearrange in terms of x. The problem I have is that I don't know how
to rearrange equations when the variables are not yet defined (I get
messages warning me that x etc can't be found). I'm not sure
2011 Oct 05
2
Subsetting a data frame with multiple values and exclusions.
Hi all,
I realise that the convention is to provide a working example of my problem
but the data are of a sensitive nature so I'm not able to do that in this
case.
I need to query a database for multiple search terms:
db <- structure(list(ind = c("ind1", "ind2", "ind3", "ind4"), test1 = c(1,
2, 1.3, 3), test2 = c(56L, 27L, 58L, 2L), test3 =
2009 Nov 12
1
Rearranging long tables, Sweave, xtable, LaTeX
Dear R-users,
consider the two following outputs, ## 1 and ## 2
\begin{Scode}{Setup, echo = FALSE, print = FALSE, eval = TRUE}
with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1,
Fact2)) ## 1
xtable(with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1,
Fact2))) ## 2
\end{Scode}
The first line
with(expand.grid(Fact1 = 1:3, Fact2 = 1:40), table(Fact1, Fact2))
2011 Apr 21
1
Rearranging PCA results from R
Hi!!
I'm having trouble selecting 10 out of 41 attributes of the KDD data set. In
order to identify the components with the higher variance I'm using
princomp. the result i get for summary(pca1) is:
Comp.1 Comp.2 Comp.3
Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
Comp.9