Closed tmieno2 closed 4 months ago
So is the permn from the combinat package
@brittanikedge, actually, should we just write our own function in place of conv_unit? We really don't use this function for many different kinds of conversions. The vast majority is ft to m and m to ft with several others like kg-lb.
@tmieno2 Sorry, I had meetings and trials to design today. We can certainly do it. As you said, it is generally for ft/m, acres/hectares, and the other options for input units.
@tmieno2 I created the .csv file with the necessary units and the function. But I have two questions about this change.
First, I noticed that the conversion of the inputs still exists in the prepare_rate_info.R. Do you want me to make that another issue and remove it as we discussed in another meeting last week?
Second, I know you wanted to put things in data-raw rather than the inst/extdata. Then how is the data accessed when the function is used? I'm not familiar with that process as system.file seems designed to work with files only in the inst folder.
@brittanikedge, sorry I just saw this!
Okay, so you can create the data object in R and then use usethis::use_data() along with other internal datasets. Then the data will be automatically saved to systata.rda in the R folder.
Work in generate_datasets.R
in the data-raw
folder. Screenshot below shows the process of saving the objects. I am pretty sure once you take a look, it become very clear.
@tmieno2 Thanks! No problem, I've been working on other things in the meantime. This is definitely very straightforward to do. I will save the conversion factors this way, check that it's working well, and close this issue!
https://stackoverflow.com/questions/35958856/using-another-r-package-function-without-using-the-whole-package-as-dependency