Displaying 2 results from an estimated 2 matches for "races2000".
Did you mean:
acer2000
2005 Feb 27
1
subsetting data set dimenion problem
(See DAAG book, p. 173, ex. 3)
I'm a new user of R, and I'm following the DAAG text. I want to create a
subset of the races2000 data frame, but get errors because of a mismatch
of values in some columns:
> library(DAAG)
> attach(races2000)
> hills2000 <- races2000[races2000$type == 'hill']
Error in as.matrix.data.frame(x) : dim<- : dims [product 770] do not
match the length of object [771]
Howe...
2005 Feb 28
0
Re: R-help Digest, Vol 24, Issue 28
You've omitted a comma. races2000 is a data frame,
which for purposes of extracting rows behaves like
a 2-dimenional object. The following works fine:
hills2000 <- races2000[races2000$type == 'hill', ]
Additionally, you might like to ponder
> type <- races2000[names(races2000)=="type"]
> ty...