AM
To: Nitu, Laurentiu
Cc: r-help@r-project.org
Subject: Re: [R] Question about addressing a data frame
is.na<http://is.na>(DF) is a matrix for a data.frame DF. The semantics of '["
are different for matrices
and data.frame and that can cause confusion
> DF <- data.frame(X=
is.na(DF) is a matrix for a data.frame DF. The semantics of '[" are
different for matrices
and data.frame and that can cause confusion
> DF <- data.frame(X=c(101,NA,NA), Y=c("one","two",NA),
row.names=c("i","ii","iii"))
> is.na(DF) # returns a matrix when given a data.frame
X Y
i FA
Hello,
I have this data frame [algae] in the package DMwR. I thought I understand how
to refer an element but I cannot explain...
is.na(algae) is giving us the a logical vector with TRUE being the na's.
which(is.na(algae)) gives the positions on the elements in the data frame where
is.na retur
3 matches
Mail list logo