New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance teaching R terminology by using variable.names() instead of names() #315

katrinleinweber opened this Issue Jan 10, 2018 · 1 comment


None yet
2 participants

katrinleinweber commented Jan 10, 2018


Did anyone experience confusion of learners about us teaching names() for the column headers, while mentioning rownames()? If yes, how about replacing the former with either:

a) colnames() to increase consistency, or
b) variable.names() to ingrain R's terminology (in the base package stats)?

Technically, they return the same:

> identical(variable.names(dat), names(dat))
[1] TRUE
> identical(variable.names(dat), colnames(dat))
[1] TRUE

PS: Unfortunately there is no observation.names() alias for rownames() :-/


This comment has been minimized.


diyadas commented Mar 22, 2018

I'd prefer a shift to colnames to match rownames, which should produce the intended result for both data frames and matrices. names doesn't map onto column names for matrices - this can be confusing for learners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment