yes it's THE solution!
thank you very much,
Simone
Il giorno 30/nov/08, alle ore 22:42, Kingsford Jones ha scritto:
It's generally easier to work with data frames, so read your data with
students <- read.spss(yourFile, to.data.frame=TRUE)
Then subset will work as expected:
subset(students
It's generally easier to work with data frames, so read your data with
students <- read.spss(yourFile, to.data.frame=TRUE)
Then subset will work as expected:
subset(students, Sex == 1)
If you would rather keep the data as a list you could do something like
lapply(students, function(x) x[stud
sorry for my bad presentation...
read.spss gives me this:
> students
$Auno
[1] 6 1 2 2 1 3 4 2 4 2 4 4 1 1 NA 1 4 2 1 1 1
5 4
[24] 2 1 2 1 2 1 4 4 1 1 1 2 1 6 1 1 1 1 1 2 1
2 1
[47] 2 2 1 4 2 4 3 1 1 1 1 3 2 1 4 4 4 4 2 4
It is.
For example, if you have a variable stored as a vector named "x", and
another variable stored as aa vector named "y", you can select cases
of y where x is greater than 3 by using
y[x>3]
However, you're going to have to provide more information in order to
get a better answer than t
?subset
On Nov 30, 2008, at 3:36 PM, Simone Gabbriellini wrote:
dear list,
I have read a spss file with read.spss()
now I have a list with all my variable stored as vectors.
is it possible to selec cases based on the value of one or more
variables?
thank you,
Simone
___
dear list,
I have read a spss file with read.spss()
now I have a list with all my variable stored as vectors.
is it possible to selec cases based on the value of one or more
variables?
thank you,
Simone
__
R-help@r-project.org mailing list
https:
6 matches
Mail list logo