Coder Social home page Coder Social logo

tiagoolivoto / pliman Goto Github PK

View Code? Open in Web Editor NEW
50.0 3.0 9.0 773.26 MB

Tools for Plant Image Analysis

Home Page: https://tiagoolivoto.github.io/pliman/

License: GNU General Public License v3.0

R 92.52% C++ 7.48%
grains count-objects disease-severity leaf-area leaf-area-index image-segmentation binary-image image-manipulation image-analysis

pliman's Introduction

pliman

CRAN status Lifecycle: stable Total Downloads CRAN RStudio mirror downloads CRAN RStudio mirror downloads CRAN RStudio mirror downloads DOI

The pliman (plant image analysis) package is designed to analyze plant images, particularly for leaf and seed analysis. It offers a range of functionalities to assist with various tasks such as measuring disease severity, counting lesions, obtaining lesion shapes, counting objects in an image, extracting object characteristics, performing Fourier Analysis, obtaining RGB values, extracting object coordinates and outlines, isolating objects, and plotting object measurements.

pliman also provides useful functions for image transformation, binarization, segmentation, and resolution. Please visit the Examples page on the pliman website for detailed documentation of each function.

Installation

Install the latest stable version of pliman from CRAN with:

install.packages("pliman")

The development version of pliman can be installed from GitHub using the pak package:

pak::pkg_install("TiagoOlivoto/pliman")

Note: If you are a Windows user, you should also first download and install the latest version of Rtools.

Analyze objects

The function analyze_objects() can be used to analyze objects such as leaves, grains, pods, and pollen in an image. By default, all measures are returned in pixel units. Users can adjust the object measures with get_measures() provided that the image resolution (Dots Per Inch) is known. Another option is to use a reference object in the image. In this last case, the argument reference must be set to TRUE. There are two options to identify the reference object:

  1. By its color, using the arguments back_fore_index and fore_ref_index
  2. By its size, using the arguments reference_larger or reference_smaller

In both cases, the reference_area must be declared. Let’s see how to analyze an image with flax grains containing a reference object (rectangle with 2x3 cm). Here, we’ll identify the reference object by its size; so, the final results in this case will be in metric units (cm).

library(pliman)
img <- image_pliman("flax_grains.jpg")
flax <- 
  analyze_objects(img,
                  index = "GRAY",
                  reference = TRUE,
                  reference_larger = TRUE,
                  reference_area = 6,
                  marker = "point",
                  marker_size = 0.5,
                  marker_col = "red", # default is white
                  show_contour = FALSE) # default is TRUE

# summary statistics
flax$statistics
#        stat        value
# 1         n 2.680000e+02
# 2  min_area 3.606989e-02
# 3 mean_area 6.250403e-02
# 4  max_area 1.262446e-01
# 5   sd_area 8.047152e-03
# 6  sum_area 1.675108e+01
# 7  coverage 5.388462e-02

# plot the density of the grain's length (in cm)
plot(flax, measure = "length")

Analyzing orthomosaics

Counting and measuring plants within plots

Here, I used mosaic_analyze() to count, measure, and extract image indexes at block, plot, and individual levels using an orthomosaic from a lettuce trial available in this paper. By using segment_individuals = TRUE, a deeper analysis is performed at individual levels, which enables counting and measuring the plants within plots. To reproduce, download the lettuce mosaic, and follow the tutorial below.

library(pliman)
set_wd_here() # set the directory to the file location
mo <- mosaic_input("lettuce.tif")
indexes <- c("NGRDI", "GLI", "SCI", "BI", "VARI", "EXG", "MGVRI")
# draw four blocks of 12 plots
an <- mosaic_analyze(mo,
           r = 1, g = 2, b = 3,
           nrow = 12,
           segment_individuals = TRUE,
           segment_index = "NGRDI",
           plot_index = indexes)

Canopy coverage and multispectral indexes

In this example, a multispectral orthomosaic originally available here is used to show how mosaic_analyze() can be used to compute the plot coverage and statistics such as min, mean, and max values of three multispectral indexes (NDVI, EVI, and NDRE) using a design that includes 6 rows and 15 plots per row. To reproduce, download the orthomosaic, save it within the current workind directory, and follow the tutorial below.

library(pliman)
set_wd_here() # set the directory to the file location
mosaic <- mosaic_input("ndsu.tif")

res <- 
  mosaic_analyze(mosaic,
                 nrow = 3,  # use 6 if you want to analyze in a single block
                 ncol = 15,
                 buffer_row = -0.15,
                 buffer_col = -0.05,
                 segment_plot = TRUE,
                 segment_index = "NDVI", 
                 plot_index = c("NDVI", "EVI", "NDRE"), 
                 summarize_fun = c("min", "mean", "max"),
                 attribute = "coverage")
res$map_plot

Counting and measuring distance betwen plants

In this example, an RGB orthomosaic from a rice field originally available here is used to show how mosaic_analyze() can be used to count plants and measure the distance between plants within each plot. The first step is to build the plots. By default a grid (grid = TRUE) is build according to the nrow and ncol arguments. In this step, use the “Drawn polygon” button to drawn a polygon that defines the area to be analyzed. After drawing the polygon, click “Done”. When the argument check_shapefile = TRUE (default) is used, users can check if the plots were correctly drawn. In this step, it is also possible to a live edition of the plots by clicking on “edit layers” button. After the changes are made, don’t forget to click “Save”. To remove any plot, just click on “Delete layers” button, followed by “Save”. After all the editions are made, click “Done”. The function will follow the mosaic analysis using the edited shapefile. After the mosaic has been analyzed, a plot is produced by default. In this plot, individuals are highlighted with a color scale showing the area of each individual. The results on both plot- and individual level are stored in data frames that can be easily exported for further analysis

To reproduce, download the rice_ex.tif mosaic, save it within the current working directory, and follow the tutorial below.

library(pliman)
set_wd_here() # set the directory to the file location
mosaic <- mosaic_input("rice_ex.tif")

res <- 
  mosaic_analyze(mosaic,
                 r = 1, g = 2, b = 3,
                 segment_individuals = TRUE,
                 segment_index = "(G-B)/(G+B-R)",
                 filter = 4,
                 nrow = 8,
                 map_individuals = TRUE)

Using an external shapefile

When a shapefile is provided there is no need to build the plots, since the function will analyze the mosaic assuming the geometries provided by the shapefile. To reproduce, download the mosaic and shapefile needed, save them within the current working directory and follow the scripts below.

library(pliman)
set_wd_here() # set the directory to the file location
# Import the mosaic
mosaic <- mosaic_input("rice_ex.tif")
# Import the shapefile
shapefile <- shapefile_input("rice_ex_shp.rds")

# analyze the mosaic using the shapefile
res <- 
  mosaic_analyze(mosaic,
                 r = 1, g = 2, b = 3,
                 shapefile = shapefile,
                 segment_individuals = TRUE,
                 segment_index = "(G-B)/(G+B-R)",
                 filter = 4,
                 map_individuals = TRUE)
# Distances between individuals within each plot
str(res$result_individ_map)

# plot-level results
str(res$result_plot_summ)

# individua-level results
str(res$result_indiv)

Disease severity

Using image indexes

To compute the percentage of symptomatic leaf area you can use the measure_disease() function you can use an image index to segment the entire leaf from the background and then separate the diseased tissue from the healthy tissue. Alternatively, you can provide color palette samples to the measure_disease() function. In this approach, the function fits a general linear model (binomial family) to the RGB values of the image. It then uses the color palette samples to segment the lesions from the healthy leaf.

In the following example, we compute the symptomatic area of a soybean leaf. The proportion of healthy and symptomatic areas is given as a proportion of the total leaf area after segmenting the leaf from the background (blue).

img <- image_pliman("sev_leaf.jpg")
# Computes the symptomatic area
sev <- 
measure_disease(img = img,
                index_lb = "B", # to remove the background
                index_dh = "NGRDI", # to isolate the diseased area
                threshold = c("Otsu", 0), # You can also use the Otsu algorithm in both indexes (default)
                plot = TRUE)

sev$severity
#    healthy symptomatic
# 1 92.62721    7.372791

Interactive disease measurements

An alternative approach to measuring disease percentage is available through the measure_disease_iter() function. This function offers an interactive interface that empowers users to manually select sample colors directly from the image. By doing so, it provides a highly customizable analysis method.

One advantage of using measure_disease_iter() is the ability to utilize the “mapview” viewer, which enhances the analysis process by offering zoom-in options. This feature allows users to closely examine specific areas of the image, enabling detailed inspection and accurate disease measurement.

img <- image_pliman("sev_leaf.jpg", plot = TRUE)

# works only in an interactive section
measure_disease_iter(img, viewer = "mapview")

Citation

citation("pliman")
Please, support this project by citing it in your publications!

  Olivoto T (2022). "Lights, camera, pliman! An R package for plant
  image analysis." _Methods in Ecology and Evolution_, *13*(4),
  789-798. doi:10.1111/2041-210X.13803
  <https://doi.org/10.1111/2041-210X.13803>.

Uma entrada BibTeX para usuários(as) de LaTeX é

  @Article{,
    title = {Lights, camera, pliman! An R package for plant image analysis},
    author = {Tiago Olivoto},
    year = {2022},
    journal = {Methods in Ecology and Evolution},
    volume = {13},
    number = {4},
    pages = {789-798},
    doi = {10.1111/2041-210X.13803},
  }

Getting help

If you come across any clear bugs while using the package, please consider filing a minimal reproducible example on github. This will help the developers address the issue promptly.

Suggestions and criticisms aimed at improving the quality and usability of the package are highly encouraged. Your feedback is valuable in making {pliman} even better!

Code of Conduct

Please note that the pliman project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

pliman's People

Contributors

olivroy avatar tiagoolivoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pliman's Issues

Include checks for mosaic_index2()

Include checks and improve user information on how to install python and gdal_calc.py. Also, translate the current indexes for numpy syntax.

leaves area without holes

Hello,

I am trying to figure it out how to estimates the areas of the three leaves in the attached files, without taking into account the small holes in the upper leaf.

I use the developement version 2.0.0.

The script I use is basically the following:

I first crop the image to get rid of the borders

leaves.crop <-
    pliman::image_crop(leaves,
                       plot = T)

After screening for index, I choose the R index. It does not discriminate the reference area from leaves, but my idea is to use afterward the function get_measures and select the reference id and its area.

I have tried several set of parameters but the closest output to what I want is the following, trying to play with extension and tolerance parameters. However, this is not totally satisfying as one of the hole is not identified, and two of the leaves are over-segmented. What would be the best strategy to overcome this ?
Thanks

res <- analyze_objects(leaves.crop,
                       index = "R",
                       fill_hull = F,
                       watershed = T,
                       extension = 1, 
                       tolerance = 20,
                       marker = "id",
                       object_size = "large"
                       )

Desbordesia glaucescens_652-PT78_L1-2-3

No mosaic_analyze funcion

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/ or https://community.rstudio.com/.

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.

Brief description of the problem

library(pliman)
> res <- mosaic_analyze(fa,
+                  nrow = 3,  # use 6 if you want to analyze in a single block
+                  ncol = 15,
+                  buffer_row = -0.15,
+                  buffer_col = -0.05,
+                  segment_plot = TRUE,
+                  segment_index = "NDVI", 
+                  plot_index = c("NDVI", "EVI", "NDRE"), 
+                  summarize_fun = c("min", "mean", "max"),
+                  attribute = "coverage")
#Error in mosaic_analyze(fa, nrow = 3, ncol = 15, buffer_row = -0.15, buffer_col = -0.05,  : 
 # 没有"mosaic_analyze"这个函数

install_github() and pak() installing older version

Hi Tiago,

Thank you for the great work with this package. I'm trying to install its dev version, but I'm afraid that the CRAN version is being installed instead. Could you please check that? Not sure how I can make this issue reproducible, but please let me know if you can grasp something from the information provided.

Thank you in advance.

devtools::install_github("TiagoOlivoto/pliman", force = TRUE)

Downloading GitHub repo TiagoOlivoto/pliman@HEAD
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file 'C:\Users\diego\AppData\Local\Temp\RtmpIPq3a6\remotes48587a6d2613\TiagoOlivoto-pliman-e0e9c29/DESCRIPTION' ...preparing 'pliman': (3.8s)
✔  checking DESCRIPTION meta-information ...cleaning srcchecking for LF line-endings in source and make files and shell scripts (620ms)
─  checking for empty or unneeded directoriesbuilding 'pliman_1.1.0.9000.tar.gz'
   
Installing package intoC:/R/R/library’
(aslibis unspecified)
* installing *source* package 'pliman' ...
** using staged installation
** libs
using C++ compiler: 'G__~1.EXE (GCC) 12.2.0'
using C++11
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c RcppExports.cpp -o RcppExports.o
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c code.cpp -o code.o
g++  -std=gnu++11 -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG  -I'C:/R/R/library/Rcpp/include' -I'C:/R/R/library/RcppArmadillo/include'   -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -fopenmp   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c code_polygons.cpp -o code_polygons.o
g++ -shared -s -static-libgcc -o pliman.dll tmp.def RcppExports.o code.o code_polygons.o -fopenmp -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lRlapack -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lRblas -lgfortran -lm -lquadmath -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-43~1.0/bin/x64 -lR
installing to C:/R/R/library/00LOCK-pliman/00new/pliman/libs/x64
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (pliman)
* 
sessionInfo()

R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: Europe/Tallinn
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1      jsonlite_1.8.5      compiler_4.3.0      crayon_1.5.2        promises_1.2.0.1   
 [6] Rcpp_1.0.10         stringr_1.5.0       callr_3.7.3         later_1.3.1         credentials_1.3.2  
[11] fastmap_1.1.1       mime_0.12           R6_2.5.1            curl_5.0.1          htmlwidgets_1.6.2  
[16] desc_1.4.2          profvis_0.3.8       rprojroot_2.0.3     openssl_2.0.6       shiny_1.7.4        
[21] rlang_1.1.1         cachem_1.0.8        stringi_1.7.12      httpuv_1.6.11       fs_1.6.2           
[26] sys_3.4.2           pkgload_1.3.2       memoise_2.0.1       cli_3.6.1           magrittr_2.0.3     
[31] ps_1.7.5            digest_0.6.31       processx_3.8.1      rstudioapi_0.14     xtable_1.8-4       
[36] remotes_2.4.2       devtools_2.4.5.9000 askpass_1.1         lifecycle_1.0.3     vctrs_0.6.2        
[41] prettyunits_1.1.1   glue_1.6.2          urlchecker_1.0.1    sessioninfo_1.2.2   pkgbuild_1.4.1.9000
[46] purrr_1.0.1         usethis_2.2.0       tools_4.3.0         ellipsis_0.3.2      htmltools_0.5.5 

could not find function "mosaic_analyze"

I have successfully installed the pliman packed. Using the code examples for "Counting and measuring plants in a plot", I get an error stating "Error in mosaic_analyze(mo, r = 1, g = 2, b = 3, nrow = 12, segment_individuals = TRUE, :
could not find function "mosaic_analyze"

get_measures outputs

I have some difficulty to interpret the outputs of the get_measures function data.frame.

For example, what are the differences between diam_max, major_axis and length ?

Likewise, differences between diam_min, minor_axis and width ?

I assume some of these measures refers to the best-fitted ellipse ?

Perhaps explanations are somewhere in the online documentation and I missed it.

Thanks for the clarification.

analyse_object error

Hello

I am testing this very promising package.

I have an error with one photo attached, using the function analyze_objects

library(pliman)

leaves <- image_import("IMG-2581.jpg", plot = TRUE)

count <- analyze_objects(leaves,
                         marker = "id")

IMG-2581

Error in EBImage::distmap(img2) : 'x' shouldn't contain any NAs

Anything I am doing wrong ?

Thanks

Release pliman 1.0.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

issue on image_crop for the CRAN version

Dear Tiago,

thanks for previous answers to my questions (and for this great package).

I have an issue that only appears on the version on CRAN using the image_crop function. I have myself the developement version which does not have this issue. I tried to instal the development version for one of my student but it did no work the reason why I installed the CRAN version.

In any case, here the line of code that provide an error :

pliman::image_crop(leaves,
                       plot = TRUE)

After selecting the two points on the plot to crop the image, he gets this error.

Error in [email protected][w, h, ] : only 0's may be mixed with negative subscripts

I dont know whether this is because he is using the CRAN version.
But when trying to install the development version from gihtub, I have the following error

devtools::install_github("TiagoOlivoto/pliman")

Downloading GitHub repo TiagoOlivoto/pliman@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet, :
download from 'https://api.github.com/repos/TiagoOlivoto/pliman/tarball/HEAD' failed

Attached is the image that causes the error but it seems to be the case for all images.
PH_1

Analyze nearinfrared pictures

Hi !

Thanks for this nice package.
Do you know how I should proceed to use it to measure symptom area from pictures obtained from a Bio-Rad ChemiDoc MP Imager with nearinfrared settings that are black and white? I have troubles using the measure_disease function on those.
po-pi-b4-l2

Thanks for your help !

Florian Rocher

ANALYZING ORTHOMOSAICS IN R WITH PLIMAN PACKAGE -FUNCTION analyze_mosaic is not present in the package

Good morning,

I was watching your video: https://www.youtube.com/watch?v=zROvQKKRPqA (ANALYZING ORTHOMOSAICS IN R WITH PLIMAN PACKAGE).

Finally I could download the package in LINUX, unfortunately I don't see the function analyze_mosaic included. The following mosaic functions are installed: mosaic_crop; mosaic_export; mosaic_index; mosaic_input; mosaic_to_pliman; mosaic_to_rgb; mosaic_view and mosaic_plot.

Can you help me please?

mosaic_analyze function dissapeared from PLIMAN package overnight

In R when you search for the function it's not appearing anymore (Please see the image I uploaded). From one day to another the function dissapeared. I just discovered that when I tried to run the following script:

res_pot<-mosaic_analyze(pot,

  •                     r=1,g=2,b=3,
    
  •                     nrow=9,
    
  •                     ncol=16,
    
  •                     buffer_row = -0.15, # 15% não é considerado entre filas
    
  •                     buffer_col = -0.05, #  5% não é considerado entre colunas
    
  •                     plot_index = c("GLI","NGRDI","VARI","BGI"),
    
  •                     summarize_fun = c("mean","stdev"),
    
  •                     plot=FALSE)
    

Error in mosaic_analyze(pot, r = 1, g = 2, b = 3, nrow = 9, ncol = 16, :
não foi possível encontrar a função "mosaic_analyze"
image (1)

Bug with the function "mosaic_analyze" when the argument "segment_individuals = TRUE"

Hi Tiago

I am using the pliman (latest version) to extract some features about the canopy of citrus plants (area, diameter, etc).
I imported the mosaic and shapefile (made in QGIS) into R without any problem. They are in the same CRS (coordinate reference system).

My mosaic (object orto) looks like this:

print(orto) # 3 camadas: R, G e B
class : SpatRaster
dimensions : 8317, 5725, 3 (nrow, ncol, nlyr)
resolution : 0.01999664, 0.01999765 (x, y)
extent : 252903.9, 253018.4, 7515062, 7515229 (xmin, xmax, ymin, ymax)
coord. ref. : WGS 84 / UTM zone 23S (EPSG:32723)
source : Ortomosaico-citrus-abril-2024.tif
names : red, green, blue

My shapefile (object parcelas) looks like this:

Simple feature collection with 373 features and 3 fields
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 252926.2 ymin: 7515102 xmax: 252989.8 ymax: 7515189
Projected CRS: WGS 84 / UTM zone 23S
First 10 features:
fid id Genotype geometry
1 1 1 H4 POLYGON ((252926.7 7515189,...
2 2 2 H6 POLYGON ((252926.4 7515186,...
3 3 3 H10 POLYGON ((252926.4 7515183,...
4 4 4 H39 POLYGON ((252926.9 7515181,...
5 5 5 V3 POLYGON ((252927.1 7515178,...
6 6 6 V6 POLYGON ((252926.8 7515176,...

I am trying to analyze the mosaic with the code below:

mosaic_analyze(mosaic = orto,
r = 1, g = 2, b = 3,
shapefile = parcelas,
include_if = "centroid",
segment_individuals = TRUE,
segment_index = "NGRDI", threshold = 0.08, invert = FALSE,
watershed = TRUE)

However, the following error always happens:

Extracting data from block 1
Error in dplyr::select():
! Can't subset columns that don't exist.
✖ Column block doesn't exist.
Run rlang::last_trace() to see where the error occurred.

If I click on the last message about the error the following is shown:

rlang::last_trace()
<error/vctrs_error_subscript_oob>
Error in dplyr::select():
! Can't subset columns that don't exist.
✖ Column block doesn't exist.


Backtrace:

  1. └─pliman::mosaic_analyze(...)
  2. ├─dplyr::select(...)
  3. └─dplyr:::select.data.frame(...)
    Run rlang::last_trace(drop = FALSE) to see 18 hidden frames.

rlang::last_trace(drop = FALSE)
<error/vctrs_error_subscript_oob>
Error in dplyr::select():
! Can't subset columns that don't exist.
✖ Column block doesn't exist.


Backtrace:

  1. ├─pliman::mosaic_analyze(...)
  2. │ ├─dplyr::select(...)
  3. │ └─dplyr:::select.data.frame(...)
  4. │ └─tidyselect::eval_select(expr(c(...)), data = .data, error_call = error_call)
  5. │ └─tidyselect:::eval_select_impl(...)
  6. │ ├─tidyselect:::with_subscript_errors(...)
  7. │ │ └─rlang::try_fetch(...)
  8. │ │ └─base::withCallingHandlers(...)
  9. │ └─tidyselect:::vars_select_eval(...)
  10. │ └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
  11. │ └─tidyselect:::eval_c(expr, data_mask, context_mask)
  12. │ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
  13. │ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
  14. │ └─tidyselect:::as_indices_sel_impl(...)
  15. │ └─tidyselect:::as_indices_impl(...)
  16. │ └─tidyselect:::chr_as_locations(x, vars, call = call, arg = arg)
  17. │ └─vctrs::vec_as_location(...)
  18. └─vctrs (local) <fn>()
  19. └─vctrs:::stop_subscript_oob(...)
  20. └─vctrs:::stop_subscript(...)
    
  21.   └─rlang::abort(...)
    

I was thinking that the problem shoud be my shapefile. So, I did a small example of shapefile (on the same mosaic) in plimanshiny and tried to run the same code with the "new" shapefile, but the error was shown again.

Helcio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.