StevenWingett / LifeSciencesTrainingDatasets

A collection of datasets and accompanying scripts for learning how to analyse data
GNU General Public License v3.0
7 stars 5 forks source link

Column names still messed up #16

Closed s-andrews closed 4 years ago

s-andrews commented 4 years ago

You still appear to be breaking the column names for column IDs which have spaces in them.

For example:

> colnames(Trainingdata::Biomass_of_Herbivorous_Fish)
[1] "Family"                                "Species"                              
[3] "Morpho..Functional.Group"              "Deep.Mean.Biomass"                    
[5] "Deep.Standard.Deviation.of.Biomass"    "Deep.Percentage"                      
[7] "Shallow.Mean.Biomass"                  "Shallow.Standard.Deviation.of.Biomass"
[9] "Shallow.Percentage"

When you load the files from the original tsv/csv files you need to add the option:

check.names=FALSE

..so that R doesn't try to get clever and 'fix' the column names.

Casey-Brown commented 4 years ago

Think I've fixed this this time?

s-andrews commented 4 years ago

Not sure - the package install is still failing:

Loading required package: usethis
Warning messages:
1: package ‘devtools’ was built under R version 4.0.2 
2: package ‘usethis’ was built under R version 4.0.2 
> install_github("StevenWingett/LifeSciencesTrainingDatasets/Trainingdata")
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.
Downloading GitHub repo StevenWingett/LifeSciencesTrainingDatasets@master
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.
√  checking for file 'C:\Users\andrewss\AppData\Local\Temp\RtmpmQPhO4\remotes43e47e564c3f\StevenWingett-LifeSciencesTrainingDatasets-7a0c4b6\Trainingdata/DESCRIPTION' (758ms)
   Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
     problem copying .\Trainingdata\data-raw\Modern Pollen–Plant Diversity Relationships Inform Palaeoecological Reconstructions of Functional and Phylogenetic Diversity in Calcareous Fen.csv to C:\Users\andrewss\AppData\Local\Temp\RtmpYd4JjG\Rbuildbec429ff3dd7\Trainingdata\data-raw\Modern Pollen–Plant Diversity Relationships Inform Palaeoecological Reconstructions of Functional and Phylogenetic Diversity in Calcareous Fen.csv: No such file or directory
    ERROR
   copying to build directory failed
Error: Failed to install 'Trainingdata' from GitHub:
  System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> * checking for file 'C:\Users\andrewss\AppData\Local\Temp\RtmpmQPhO4\remotes43e47e564c3f\StevenWingett-LifeSciencesTrainingDatasets-7a0c4b6\Trainingdata/DESCRIPTION' ... OK
E> Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
E>   problem copying .\Trainingdata\data-raw\Modern Pollen–Plant Diversity Relationships Inform Palaeoecological Reconstructions of Functional and Phylogenetic Diversity in Calcareous Fen.csv to C:\Users\andrewss\AppData\Local\Temp\RtmpYd4JjG\Rbuildbec429ff3dd7\Trainingdata\data-raw\Modern Pollen–Plant Diversity Relationships Inform Palaeoecological Reconstructions of Functional and Phylogenetic Diversity in Calcareous Fen.csv: No such file or directory
E>  ERROR
E> copying to build directory failed
Casey-Brown commented 4 years ago

Oh wait I can fix that I think, the file name has non ascii characters I think, this happened before

s-andrews commented 4 years ago

To be safe it's better to have no odd characters and no spaces in filenames.

Casey-Brown commented 4 years ago

Yeah thats the meta data so I haven't named it myself, I just forgot to change it to something that doesn't break everything, same thing happened when I first imported the data

Casey-Brown commented 4 years ago

If I was right about that problem it should hopefully work now

s-andrews commented 4 years ago

Nope sorry. Same error as before.

Casey-Brown commented 4 years ago

I've just remove it for now to see if that would solve it and I'll have a look at it a bit more closely

s-andrews commented 4 years ago

It builds now. It might be that that file name just makes the total file path too long. I'd try a shorter name and that may well fix it.