[R-pkg-devel] Installed image not found in Debian

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed May 12 00:06:26 CEST 2021

Why aren't you using system.file()?

On May 11, 2021 1:45:37 PM PDT, Tiago Olivoto <tiagoolivoto using gmail.com> wrote:
>Dear all,
>I just submitted a new package 'pliman' (
>https://github.com/TiagoOlivoto/pliman) and it does not pass the
>checks automatically.
>I have some images that are under '/inst/tmp_images' to be installed
>the package. In some examples and Vignettes, I use the helper function
>image_pliman() <
>to get the patch of a given image
>Then, I use image_import() <
>import the image into R.
>All tests passed in Windows <
>but an error was got in Debian <
>The error occurs when image_import () has been called, for example
>Error:  'soybean_touch' not found in
>It seems that this error comes from this check <
>that checks if the image name is available in the directory. Please,
>see a
>toy example with my data.
># Get the patch of the image
>image <- image_pliman("soybean_touch.jpg")
># Get the directory of the image
>img_dir <- file_dir(image)
>> img_dir
>[1] "E:/Documents/R/win-library/4.0/pliman/tmp_images"
># Get all files in the directory
>> all_files <- sapply(list.files(img_dir), file_name)
>> all_files
>background.jpg        la_back.jpg        la_leaf.jpg      la_leaves.JPG
>  "background"          "la_back"          "la_leaf"        "la_leaves"
>la_pattern.JPG        la_temp.jpg objects_300dpi.jpg       sev_back.jpg
>  "la_pattern"          "la_temp"   "objects_300dpi"         "sev_back"
>sev_healthy.jpg       sev_leaf.jpg    sev_leaf_nb.jpg     
> "sev_healthy"         "sev_leaf"      "sev_leaf_nb"        "sev_sympt"
>     soy_green.jpg  soybean_grain.jpg  soybean_touch.jpg
>       "soy_green"    "soybean_grain"    "soybean_touch"
># Get the name of the image and check if it is in the directory
>> img_name <- file_name(image)
>> img_name
>[1] "soybean_touch"
>if(!grepl("http", img_dir, fixed = TRUE) & !img_name %in% all_files){
>  stop(" '", img_name, "' not found in ", img_dir,  call. = FALSE)
>In this case, there is no error since  "soybean_touch" is in
>I have no idea how to fix this issue and why this error occurs only on
>Debian and not on Windows. Any suggestion to fix the error and/or
>the code will be welcome!
>Thanks in advance,
>	[[alternative HTML version deleted]]
>R-package-devel using r-project.org mailing list

Sent from my phone. Please excuse my brevity.

More information about the R-package-devel mailing list