Skip to contents

Get module names or update which sections are used by an ecological or data-status report. Profiles provide named, reusable selections without moving or duplicating the YAML module files.

Usage

section_names(keep, exclude, object, profile, report_type)

sections(x, n, profile, report_type)

Arguments

keep

An optional character vector of section names to keep.

exclude

An optional character vector of section names to exclude.

object

An optional camReport object. It is needed to inspect user-defined profiles registered in that object.

profile

An optional profile name or reportProfile object.

report_type

Which output selection to use: "report", "status", or, for section_names(), "all".

x

A camReport object created by camData().

n

An optional character vector of modules to include. Qualified names such as "status::spatial" can select from the other module pool when a profile is being edited.

Value

section_names() and sections(x) return character vectors. sections(x, n) updates x and returns it invisibly. Unknown names in a partially valid sections(x, n) selection are ignored with a warning naming those sections. An entirely unknown selection errors.

Details

section_names() lists modules in a pool or in a profile. Set report_type = "all" to list both pools. Names from both pools, and names returned for a profile, use the unambiguous "source::module" notation.

sections() updates the transient module tree used for the next render. When profile is supplied, it can also inspect or update that registered profile. Set report_type = "status" to manage the data-status selection.

Examples

section_names()
#>  [1] "introduction"              "methods"                  
#>  [3] "study_area"                "sampling"                 
#>  [5] "location"                  "location_eow"             
#>  [7] "effort"                    "effort_eow"               
#>  [9] "image_processing"          "data_processing"          
#> [11] "results"                   "captures"                 
#> [13] "abundance_trends"          "abundance_trends_eow"     
#> [15] "population_density"        "population_density_annual"
#> [17] "model_parameters"          "model_parameters_eow"     
#> [19] "population_densities"      "population_densities_eow" 
#> [21] "activity_patterns"         "activity_patterns_eow"    
#> [23] "richness"                  "co_occurrence"            
#> [25] "spatial_density"           "habitat_preferences"      
#> [27] "species_accumulation"      "acknowledgements"         
#> [29] "appendix"                  "appendix_eow"             
#> [31] "References"                "References_eow"           
section_names(profile = "default")
#>  [1] "report::introduction"         "report::methods"             
#>  [3] "report::study_area"           "report::sampling"            
#>  [5] "report::location"             "report::effort"              
#>  [7] "report::image_processing"     "report::data_processing"     
#>  [9] "report::results"              "report::captures"            
#> [11] "report::abundance_trends"     "report::population_density"  
#> [13] "report::model_parameters"     "report::population_densities"
#> [15] "report::activity_patterns"    "report::richness"            
#> [17] "report::co_occurrence"        "report::spatial_density"     
#> [19] "report::habitat_preferences"  "report::species_accumulation"
#> [21] "report::acknowledgements"     "report::appendix"            
#> [23] "report::References"          
section_names(report_type = "all")
#>  [1] "report::introduction"              "report::methods"                  
#>  [3] "report::study_area"                "report::sampling"                 
#>  [5] "report::location"                  "report::location_eow"             
#>  [7] "report::effort"                    "report::effort_eow"               
#>  [9] "report::image_processing"          "report::data_processing"          
#> [11] "report::results"                   "report::captures"                 
#> [13] "report::abundance_trends"          "report::abundance_trends_eow"     
#> [15] "report::population_density"        "report::population_density_annual"
#> [17] "report::model_parameters"          "report::model_parameters_eow"     
#> [19] "report::population_densities"      "report::population_densities_eow" 
#> [21] "report::activity_patterns"         "report::activity_patterns_eow"    
#> [23] "report::richness"                  "report::co_occurrence"            
#> [25] "report::spatial_density"           "report::habitat_preferences"      
#> [27] "report::species_accumulation"      "report::acknowledgements"         
#> [29] "report::appendix"                  "report::appendix_eow"             
#> [31] "report::References"                "report::References_eow"           
#> [33] "status::abstract"                  "status::spatial"                  
#> [35] "status::temporal"                  "status::availability"             
#> [37] "status::validation"                "status::annotation"               
#> [39] "status::observation_type"          "status::conclusion"               
#> [41] "status::acknowledge"              

# \donttest{
# Section selection needs only a small imported dataset.
source_dataset <- system.file(
  "external", "example-small", package = "camtrapReport"
)
example_dataset <- tempfile("camtrapReport-example-")
dir.create(example_dataset)
invisible(file.copy(
  list.files(source_dataset, full.names = TRUE),
  example_dataset,
  recursive = TRUE
))
cm <- camData(example_dataset)
#> The camReport object is being created...
#> Dataset size: 164.4 KB.
#> File size looks modest, but full object creation may still take several minutes depending on the number of records.
#> Taxonomic class is unavailable for 10 recorded taxa. Class-dependent groups and mammal counts may be incomplete; missing classification does not indicate ecological absence. Supply source classifications or explicitly enable GBIF enrichment and rebuild with update = TRUE.
#> Setup is done!
#> Data loaded successfully in 8 sec.
#> camReport object is ready for GMU8 LEUVEN.
sections(cm, profile = "default")
#>  [1] "report::introduction"         "report::methods"             
#>  [3] "report::study_area"           "report::sampling"            
#>  [5] "report::location"             "report::effort"              
#>  [7] "report::image_processing"     "report::data_processing"     
#>  [9] "report::results"              "report::captures"            
#> [11] "report::abundance_trends"     "report::population_density"  
#> [13] "report::model_parameters"     "report::population_densities"
#> [15] "report::activity_patterns"    "report::richness"            
#> [17] "report::co_occurrence"        "report::spatial_density"     
#> [19] "report::habitat_preferences"  "report::species_accumulation"
#> [21] "report::acknowledgements"     "report::appendix"            
#> [23] "report::References"          
cm <- sections(cm, c("introduction", "methods"))
#> 
#> The report sections are updated.
unlink(example_dataset, recursive = TRUE, force = TRUE)
# }