Erik Iverson wrote:
Spencer -

Spencer wrote:

Dear R Experts,

I am trying to create several subsets that I want to use as separate datasets. After separate subsets are created for each country, I want to do some calculations for each. I did the following:

data <- data.frame(na.omit(read.spss("trial.sav")))

attach (data)

You might not want to call it 'data' since 'data' is the name of a function in base R.

Also, the usual advice is to avoid attaching data.frames to the search path, for the exact reasons that happen to you below.


Netherlands <- subset(data, COUNTRY = "NETHERLANDS")
attach(Netherlands)

But after this step, when I check the summary statistics for "Netherlands," what returns is the summary for the original dataset.


Actually, this might not make sense to me. What do you mean 'check the summary statistics for Netherlands".

What command are you giving  to R to do that?

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to