Search code examples
rspatialsentinel2

unable to get sen2r function working, some arguments missing?


I am trying to use to sen2r() function (Package sen2r_1.3.2) with default parameters but getting the following error:

Error in paste(c(...), collapse = sep) : argument is missing, with no default.

I know the error wants me to fill in some parameters, but the source manual clearly says that the default should work, and the parameters can be set subsequently upon launching the GUI.

Using the s2_gui() launches the shiny app, but keeps hanging when I try to "Save and Close"

   R version 3.6.3 (2020-02-29)
   Platform: x86_64-pc-linux-gnu (64-bit)
   Running under: Ubuntu 18.04.4 LTS

Also, can someone with a 'higher reputation' please create a sen2r tag, for easier subsequent communications?


Here is the traceback...

sen2r()
Error in paste(c(...), collapse = sep) : 
  argument is missing, with no default
> traceback()
7: paste(c(...), collapse = sep)
6: strsplit(paste(c(...), collapse = sep), "\n")
5: unlist(strsplit(paste(c(...), collapse = sep), "\n"))
4: strwrap(unlist(strsplit(paste(c(...), collapse = sep), "\n")), 
       width = width, indent = indent, exdent = exdent, prefix = prefix, 
       initial = initial)
3: print_message(type = "waiting", "It seems you are running this package for the first time. ", 
       "Do you want to verify/install the required dependencies using a GUI (otherwise, an\n        automatic check will be performed)? (y/n) ", 
       )
2: .sen2r(param_list = param_list, pm_arg_passed = pm_arg_passed, 
       gui = gui, preprocess = preprocess, s2_levels = s2_levels, 
       sel_sensor = sel_sensor, online = online, order_lta = order_lta, 
       apihub = apihub, downloader = downloader, overwrite_safe = overwrite_safe, 
       rm_safe = rm_safe, step_atmcorr = step_atmcorr, sen2cor_use_dem = sen2cor_use_dem, 
       sen2cor_gipp = sen2cor_gipp, max_cloud_safe = max_cloud_safe, 
       timewindow = timewindow, timeperiod = timeperiod, extent = extent, 
       extent_name = extent_name, s2tiles_selected = s2tiles_selected, 
       s2orbits_selected = s2orbits_selected, list_prods = list_prods, 
       list_rgb = list_rgb, list_indices = list_indices, index_source = index_source, 
       rgb_ranges = rgb_ranges, mask_type = mask_type, max_mask = max_mask, 
       mask_smooth = mask_smooth, mask_buffer = mask_buffer, clip_on_extent = clip_on_extent, 
       extent_as_mask = extent_as_mask, reference_path = reference_path, 
       res = res, res_s2 = res_s2, unit = unit, proj = proj, resampling = resampling, 
       resampling_scl = resampling_scl, outformat = outformat, rgb_outformat = rgb_outformat, 
       index_datatype = index_datatype, compression = compression, 
       rgb_compression = rgb_compression, overwrite = overwrite, 
       path_l1c = path_l1c, path_l2a = path_l2a, path_tiles = path_tiles, 
       path_merged = path_merged, path_out = path_out, path_rgb = path_rgb, 
       path_indices = path_indices, path_subdirs = path_subdirs, 
       thumbnails = thumbnails, parallel = parallel, processing_order = processing_order, 
       use_python = use_python, tmpdir = tmpdir, rmtmp = rmtmp, 
       log = log, globenv = sen2r_env, .only_list_names = FALSE)
1: sen2r()

I ran s2_gui() as is...no parameters specified. But i am running the dependency check now, I suspect that should clear things up even for the GUI.


Solution

  • This error was due to a code bug, which was fixed (see the GitHub issue 292).

    Until the sen2r CRAN version will be updated, the bug can be:

    1. solved installling the sen2r GitHub version (remotes::install_github("ranghetti/sen2r")), or
    2. bypassed launching check_gdal() before running sen2r().