[R] Question about addressing a data frame
Nitu, Laurentiu
L@urent|u@N|tu @end|ng |rom |r@@erhe@|th@c@
Tue Apr 23 20:19:00 CEST 2019
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 returns TRUE.
However which(is.na(algae)) returns
[1] 648 838 862 1055 1056 1057 1058 1059 1060 1061 1062 1161 1199 1262 1399 1462 1599 1662 1799 1828 1999 2055 2056 2057 2058 2059 2060 2061 2062 2063
[31] 2116 2184 2199
Weirs since:
> dim(algae)
[1] 200 18
If I refer back algae[which(is.na(algae))) I get a vector of NA's...
What are the values returned by which(is.na(algae))?
Thanks a lot for your help
[[alternative HTML version deleted]]
More information about the R-help
mailing list