Hi,
This is not clear. May be this helps:
dat - read.table(text=cid cname
101 us
102 uk
103 gm
104 NA
105 SA
106 fr
102 us
104 fr
105 gm
101 uk
102 us
106 SA
103 gm
105 SA
101 us
106 fr,sep=,header=TRUE,stringsAsFactors=FALSE)
lst1 - split(dat,list(dat$cid,dat$cname),drop=TRUE)
You missed the first, the most important line of str() output.
What type is your data?
--
View this message in context:
http://r.789695.n4.nabble.com/Filter-data-tp3070069p3108011.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi
Hm. Does str(poli) revealed said explicitly that poli is data frame? I
presume that it told you that it is list. In that case you need to use
appropriate indexing, which suits structure of your list.
Regards
r-help-boun...@r-project.org napsal dne 02.12.2010 22:06:15:
Simplified
Hello,
I understand that question is probably stupid, but ...
I have data (polity IV index)
country,year,democ,autoc,polity,polity2
1,Afghanistan ,1800,1,7,-6,-6
2,Afghanistan ,1801,1,7,-6,-6
3,Afghanistan ,1802,1,7,-6,-6
I need to create new data sets which
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of Diogenas
Sent: Thursday, December 02, 2010 12:09 PM
To: r-help@r-project.org
Subject: [R] Filter data
Hello,
I understand that question is probably stupid, but ...
I
Simplified version of str(poli): (real dataset includes 36 variables)
$ country : chr [1:15846] Afghanistan Afghanistan
Afghanistan Afghanistan ...
$ year: num [1:15846] 1800 1801 1802 1803 1804 ...
$ democ : num [1:15846] 1 1 1 1 1 1
Hi Diogenas,
Try this,
data-subset(poli, poli$year1994)
Best,
M
Diogenas dioge...@gmail.com a écrit :
Hello,
I understand that question is probably stupid, but ...
I have data (polity IV index)
country,year,democ,autoc,polity,polity2
1,Afghanistan ,1800,1,7,-6,-6
2,Afghanistan
Try looking at subset()... I typically use this when I'm trying to isolate
specific cases from a data frame.
Also, Dalgaard's introductory R book has some great examples for parsing
data in the manner you're attempting you might want to look at that.
Mike
On Thu, Dec 2, 2010 at 2:08 PM,
?merge
Let the data.frame be xx
yy - data.frame(ORF=
c(YAL026C,YAL041W,YAL048C,YAL007C,YAL012W,
YAL016W ))
merge(xx,yy, by=ORF)
should do it.
--- Roberto Olivares Hernandez [EMAIL PROTECTED] wrote:
Hi,
I have a data frame Y with the following
information,
ORF
Hi Roberto,
One of these ?
Y[ Y$ORF %in% X , ]
ORF spectra
3 YAL007C 2
4 YAL012W 8
5 YAL016W 24
11 YAL026C 2
16 YAL041W 4
18 YAL048C 1
subset( Y, ORF %in% X )
ORF spectra
3 YAL007C 2
4 YAL012W 8
5 YAL016W 24
11 YAL026C
Hi,
I have a data frame Y with the following information,
ORF spectra
1 YAL001C 2
2 YAL005C 21
3 YAL007C 2
4 YAL012W 8
5 YAL016W 24
6 YAL019W 3
7 YAL020C 2
8 YAL021C 7
9 YAL022C 3
10 YAL023C 6
11 YAL026C 2
12 YAL029C
Hi,
I have a data frame Y with the following information,
ORF spectra
1 YAL001C 2
2 YAL005C 21
3 YAL007C 2
4 YAL012W 8
5 YAL016W 24
6 YAL019W 3
7 YAL020C 2
8 YAL021C 7
9 YAL022C 3
10 YAL023C 6
11 YAL026C 2
12 YAL029C
12 matches
Mail list logo