1

我正在尝试使用带有默认参数的 sen2r() 函数(包 sen2r_1.3.2),但出现以下错误:

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

我知道错误要我填写一些参数,但源手册清楚地表明默认值应该可以工作,并且可以在启动 GUI 时随后设置参数。

使用 s2_gui() 启动闪亮的应用程序,但当我尝试“保存并关闭”时一直挂起

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

另外,是否可以请具有“较高声誉”的人创建一个 sen2r 标签,以便于后续通信?


这是追溯...

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()

s2_gui()按原样运行...没有指定参数。但是我现在正在运行依赖项检查,我怀疑即使是 GUI 也应该可以解决问题。

4

2 回答 2

2

此错误是由代码错误引起的,该错误已修复(请参阅GitHub 问题 292)。

在 sen2r CRAN 版本更新之前,bug 可能是:

  1. 解决了安装 sen2r GitHub 版本 ( remotes::install_github("ranghetti/sen2r")),或
  2. check_gdal()在运行 sen2r() 之前绕过启动。
于 2020-03-22T07:52:55.223 回答
1

这是原始代码中的一个错误。

在您提供的回溯中,它包括:

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) ", 
       )

值得注意的是,我将截断大部分字符串:

3: print_message(type = "waiting", "It seems ... time. ", 
       "Do you ... performed)? (y/n) ",  
       )                         #    ^-- extra comma, invalid R syntax

请注意它是如何以逗号和右括号结尾的?是的,这是 R 中的语法错误。(这已在原始回购中作为问题 292提交。)

于 2020-03-22T05:28:32.007 回答