On Tue, Nov 9, 2010 at 9:43 AM, Joshua Wiley wrote:
> On Tue, Nov 9, 2010 at 9:39 AM, Joshua Wiley wrote:
>> Hi Kate,
>>
>> is.na() does not work on entire data frames.
>
> whoops, I did not mean that. is.na() has a data frame method, but
> there are assignment issues (as you saw) when you use i
On Tue, Nov 9, 2010 at 9:39 AM, Joshua Wiley wrote:
> Hi Kate,
>
> is.na() does not work on entire data frames.
whoops, I did not mean that. is.na() has a data frame method, but
there are assignment issues (as you saw) when you use it that way.
Josh
[snip]
Kate -
As the error message indicates, num.strata is a
factor. This can occur when you're reading in data
and R encounters a non-numeric value which was not
specified in the na.strings= argument to read.table.
To do what you want, you'll need to convert it to a
character variable first:
Hi Kate,
is.na() does not work on entire data frames. You just need to specify
the column, for example:
data[is.na(data[, 8]), 8] <- 0
if the NAs were in column 8.
Best regards,
Josh
On Tue, Nov 9, 2010 at 9:33 AM, Kate Hsu wrote:
> Dear r-users,
>
> Basically, I have a data as follows,
>
Dear r-users,
Basically, I have a data as follows,
> data
S s1 s2 s3 s4 s5 prob obs num.strata
1 N N N N N N 0.108 32
2 Y N N N N Y 0.0005292 16
3 NNNYN N N N Y N 0.0005292 24
4 NNNYY N N N Y Y 0.0259308 8 1
5 matches
Mail list logo