Hello Jim:
Yes, that's exactly what I needed!
Thank you!
Josip
- Original Message -
From: "jim holtman"
To: "Josip Dasovic"
Cc: r-help@r-project.org
Sent: Tuesday, January 27, 2009 4:45:31 PM GMT -08:00 US/Canada Pacific
Subject: Re: [R] Data Frame Manipula
Is the what you are after:
> df<-data.frame(cbind("country"=c(rep("Angola", 9), rep("Burundi", 7),
+ rep("Chad", 13)), "year"=c(1975:1983, 1989:1995, 1965:1977)),
+ "war"=c(rep(1,2), rep(0,5), rep(1,2), rep(1,2), rep(0,2), rep(1,3),
+ rep(1,4), rep(0,6), rep(1,3)))
> x <- split(df,
Dear R Helpers:
I have a data set where the unit of observation is country-year. I would like
to generate a new data set based on some inclusionary (exclusionary) criteria.
Here is an example of the type of data that I have.
df<-data.frame(cbind("country"=c(rep("Angola", 9), rep("Burundi", 7),
3 matches
Mail list logo