DistanceDevelopment / dsm

Density surface modelling for distance sampling.
http://distancesampling.org/R/
GNU General Public License v3.0
8 stars 9 forks source link

Case sensitivity of column names in input data #7

Closed erex closed 4 years ago

erex commented 9 years ago

Both dsm() and and ds() are a bit eclectic in their use of upper case characters to begin column names. Rather than throwing an error, might it be possible to upcase first letter, lowercase other letters for all columns, as

first.letter  <- substring(names(my.data2), 1, 1)
other.letters <- tolower(substring(names(my.data2), 2))
newnames      <- paste(first.letter, other.letters, sep="")

Stolen from http://stackoverflow.com/questions/13258020/change-letter-case-of-column-names.

Concept highlighted by email correspondence with julia.migne@laposte.net on 21 May 2015:

1) The size column in obsdata was "Size" rather than "size". I've fixed a check in dsm to make sure folks are alerted to this.

dill commented 4 years ago

Changing column name specs will break a lot of existing code. Column names are documented in the dsm-data manual page and in vignettes. As for the corresponding Distance issue, allowing any case combination will likely cause untold other issues, so I'm moving this to wontfix.