StatisticalServicesCentre / ClimateObject

This R code
GNU General Public License v3.0
0 stars 7 forks source link

Location of .R-files for successful compilation #12

Open rposn opened 9 years ago

rposn commented 9 years ago

I am not able to compile the ClimObject package correctly, since the R files contained in the "Climate Methods" folder are not loaded when building the package. (I guess all .R files have to be saved in the default "R" folder): Therefore I am going to add the new methods (windrose, timeseries and histogram) into the "R" file. When doing so, the methods can be run without problems after compiling. This also allows the creation of documentation using "roxygen". Let me know if you know how to compile the R package, so that the methods saved in the "Climate Methods" are also loaded. Also, I would avoid "blank spaces" in the name of the folders. I suggest to use "climate_methods" instead of "Climate Methods"

ntfredo commented 9 years ago

I am loading the methods saved in CimateMethods by sourcing them. ex: source("C:/Users/Fredo/Documents/AMI/climate_objects/updated_climate_stuff/ClimateObject/ClimateMethods/DataManipulation/seasonal_summary_method.R") About avoiding the "blank spaces" in the name of the folder; I think this is fixed now.

whughes1 commented 9 years ago

On Mon, 2015-05-11 at 01:50 -0700, rposn wrote:

I am not able to compile the ClimObject package correctly, since the R files contained in the "Climate Methods" folder are not loaded when building the package. (I guess all .R files have to be saved in the default "R" folder):

Correct. This is a limitation of the R build mechanism. There is no easy way around it.

-William Hughes

rposn commented 9 years ago

Thanks for your responses. @ntfredo What I am not sure is whether the functions that are outside of the "R" will be compiled automatically to build the package. It might be possible to source them, but I do not know if when compiling they will be part of the package...

Fshem commented 9 years ago

Thanks @rposn. I am also not sure about how all this will work. If putting the methods in "R" will allow for the automatic compilation then this is the way to go rather than having the methods in a different directory.

On 12 May 2015 at 15:08, rposn notifications@github.com wrote:

Thanks for your responses. @ntfredo https://github.com/ntfredo What I am not sure is whether the functions that are outside of the "R" will be compiled automatically to build the package. It might be possible to source them, but I do not know if when compiling they will be part of the package...

— Reply to this email directly or view it on GitHub https://github.com/StatisticalServicesCentre/ClimateObject/issues/12#issuecomment-101253325 .

rposn commented 9 years ago

Hi All, I am still not able to compile the climateObject package correctly, since R does not recognize the .R files saved in the folders (at least I cannot find a way to make R recognize them). Do you have any idea on how to overcome this issue? It is important to be able to compile the package with all the methods, so that they will be available for the user when calling the "climate" object.

rposn commented 9 years ago

Hi All, I have found some information about subfolders within the R folder in the R-Package and it seems there is not a straight way to compile the .R files located in subfolders (see http://stackoverflow.com/questions/18584807/code-organisation-in-r-package-development). It is recommended to have the .R files directly in the R folder. As said in the link, I would suggest to use prefixes...