Closed bschilder closed 3 years ago
ah i see, it's a data object included in MungeSumstats but not exposed to users. will clarify this with explicit syntax:
MungeSumstats:::sumstatsColHeaders
NOTE: Ended up removing this bc Check didn't like it.
Functions that use sumstatsColHeaders
now seem to be unable to find it despite it being a a built-in dataset. Resolving with data("sumstatsColHeaders")
for now.
#' @keywords internal
#' @importFrom data.table setnames
standardise_sumstats_column_headers_crossplatform <-
function(sumstats_dt, path) {
message("Standardising column headers.")
# sumstatsColHeaders <- MungeSumstats:::sumstatsColHeaders
data("sumstatsColHeaders")
...
...
You can't use MungeSumstats:::sumstatsColHeaders
as now CRAN/Bioconductor checks will pick that up as a internal package function call which isn't allowed. I actually think it's correct to just call the dataset by name like I had?
@Al-Murphy I agree that the correct way should be the way you originally had it. But for some reason MungeSumstats couldnt find it at some point. Perhaps I should try again the old way and see if it's fixed itself.
It can't find it when you try run the functions separate to the package. This happens since the dataset is an internal one meaning it isn't open to the user. It will find the package when you call functions from within the package
Oh i see, i must have been running the functions after sourcing them. I'll go ahead and remove the data("dataset") syntax then and put it back the way it was
I just tried it the original way, and MungeSumstats fails the checks bc it can't find the object. I cleared my R session first so I can confirm it was not due to sourced functions overriding internal functions.
@Al-Murphy any idea what's going on?
Have a look at the master branch to compare approach against what you have? It's working fine there
Just found out this was totally my bad; i deleted sysdata.rda
thinking it was a extra file i had accidentlaly created. Just re-downloaded it from master and add back into the dev branch:
https://github.com/neurogenomics/MungeSumstats/blob/master/R/sysdata.rda
Can't seem to find where this is defined, unless the user defines it as a global beforehand.