rshinygolem

Error in: Could not find a root 'DESCRIPTION' file that starts with '^Package'


I'm developing a shinyapp with golem. From my computer everything works perfectly, but then I loaded the package on github and installed on another computer. The app has two main parts: the first where you can process raw data and save the output as a .rds file, and the second where you can analyze the elaborated data (you can also upload a .rds file already processed). The problem is in the first part and when I have to read multiple files. It gives me this error:

Error in: Could not find a root 'DESCRIPTION' file that starts with '^Package' in 'C:\Users\Della Rocca\Documents'. 
Are you in your project directory, and does your project have a 'DESCRIPTION' file?

I can copy the server part where the problem appears:

  # this makes the directory at the base of your computer.
  volumes = c(Home = fs::path_home(), shinyFiles::getVolumes()()) 
  
  
  ####select the data folder where to read data
  shinyFiles::shinyDirChoose(input, 'datafolder', roots = volumes, session = session)
  
  data_path = reactive({
    if(length(input$datafolder) != 1 ) {
      shinyFiles::parseDirPath(volumes,input$datafolder)
    }else{
      NULL
    }
  })
  

  stepb = eventReactive(input$readdatabttn,{
    req(data_path(), targets(), analysis())
    
    stepa = list(targets = targets(), analysis = analysis())
    withProgress(message = "Reading data...", value=0, {

      #external function that takes the path and reads multiple .txt files catching names from the target_file (a .xlsx file)
      read_advise_lipidomics(out = stepa, datapath = data_path(), target_file = stepa$targets$targetfile_lipidomics)
    })
    
  })

data_path() it's ok because it has the correct path. The problem is when I trigger the eventReactive() with the button input$readdatabttn.

Do you know what is that error? I have the description file and running devtools::check() I have no errors and just a warning:

> checking Rd \usage sections ... WARNING
  Undocumented arguments in documentation object 'calibplot_advise_lipidomics'
    'plot_calibration'
  
  Undocumented arguments in documentation object 'create_beautiful_radarchart'
    'vlabels' 'title' '...'
  
  Undocumented arguments in documentation object 'na_advise_lipidomics'
    'na_filter_lip' 'na_filter_sam' 'imputation_met' 'imputation_val'
  
  Undocumented arguments in documentation object 'read_advise_lipidomics'
    'datapath'
  
  Undocumented arguments in documentation object 'recovery_advise_lipidomics'
    'intercept_flag'
  
  Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapter 'Writing R documentation files' in the 'Writing R
  Extensions' manual.

Solution

  • I solved. The problem was that in the code I take the package version and save it in a variable. I used the function golem::get_golem_version() and this function works only in my dev project directory, in every other project (even on the same computer) doesn't work. For now I write by myself the version, but I would like to automate it.

    EDIT: I used packageVersion() with my package name inside and for now it works.