Imports data regarding occurrence of wood from files under path (path>1 directory=1 event>all logs of the event)

import_Wdata(path, site = path, min_length = NA, sample_length = FALSE)

Arguments

path

the path towards the events directory

site

the name of the site considered

min_length

the minimum length for a wood piece to be included in the dataset. Defaults to NA (no filtering).

sample_length

whether to sample the wood pieces with no length provided, according to the proportion of pieces with Length>min_length. Defaults to FALSE.

Value

Wdata

Examples

Wdata=import_Wdata("data-raw/wood_data_Ain", site="Ain")
#> Warning: Unknown or uninitialised column: `Time`.
#> Warning: tz(): Don't know how to compute timezone for object of class NULL; returning "UTC". This warning will become an error in the next major version of lubridate.
Wdata=import_Wdata("data-raw/wood_data_Allier", site="Allier", min_length=1, sample_length=TRUE)
#> Warning: Unknown or uninitialised column: `Time`.
#> Warning: tz(): Don't know how to compute timezone for object of class NULL; returning "UTC". This warning will become an error in the next major version of lubridate.
#> Error in dplyr::mutate(., length_provided = !is.na(Length)): Problem while computing `length_provided = !is.na(Length)`.
#> Caused by error:
#> ! object 'Length' not found