jbferet / biodivMapR

biodivMapR: an R package for α- and β-diversity mapping using remotely-sensed images
https://jbferet.github.io/biodivMapR/index.html
GNU General Public License v3.0
47 stars 13 forks source link

Double forward slash in *select_PCA_components()* function #10

Closed ninimalina closed 3 years ago

ninimalina commented 3 years ago

Hello,

When running the select_PCA_components() function I got the following error: Error in editor(file = file, title = title) : argument "name" is missing, with no default After checking the code I found an additional "/" in the Sel_PC resulting from the additional "/".

The path was as follows: "C:/Users/.../S2A_T33NUD_20180104_Subset/SPCA//PCA/Selected_Components.txt" Changing the following line of code: Sel_PC <- paster(Output_Dir_Full, "/PCA/Selected_Components.txt", sep = "". to: Sel_PC <- paster(Output_Dir_Full, "PCA/Selected_Components.txt", sep = "". resolved the error.

There is already a forward slash in: Output_Dir_Full <- paste(Output_Dir, "/", Image_Name, "/", TypePCA, "/", sep = "")

I hope my explanations are clear.

Thank you for this package! I am currently looking through the code and read the papers! This is amazing!

Best, Niamh

jbferet commented 3 years ago

Hi Niamh, Thank you for your message. Yes indeed, as you have noticed if you went through my codes, this would deserve some work to get closer to standards and good programming practices... I am trying to get there, but the road is still long!

I recently pushed a new version of the package, and the latest corrections use file.path instead of paste, which should fix the error you identified.

Thanks a lot, it is nice to hear that you are enthusiastic about it!

Cheers,

jb