Displaying 1 result from an estimated 1 matches for "edux".
Did you mean:
edu
2004 Dec 07
1
how to test the existence of a name in a dataframe
...ly a substring of another name) in a dataframe.
I did e.g.:
> data(swiss)
> names(swiss)
[1] "Fertility" "Agriculture" "Examination" "Education"
[5] "Catholic" "Infant.Mortality"
> ! is.null(swiss$EduX)
[1] FALSE
> ! is.null(swiss$Edu)
[1] TRUE
I did not expect to get TRUE here because ``Edu'' does not exist
as name of ``swiss''.
I did finally:
> 'Edu' %in% names(swiss)
for which I got the expected FALSE.
My question: What is the recommended way to do such a test...