Skip to contents

This function retrieves information about the last truffle found on a specific oak tree.

Usage

get_info_chene_last_truffe(dbtruffe, theidoak, filter_missing_info = FALSE)

Arguments

dbtruffe

A data frame containing information about truffles.

theidoak

The ID of the oak tree.

filter_missing_info

logical to filter truffle with missing data

Value

A data frame containing information about the last truffle found on the specified oak tree.

Examples


dbtruffe <- data.frame(
  idoak = c("123", "123", "456", "789"),
  estimation = c(1, 0, 1, 0),
  weight = c(NA, 5, 10, 100),
  date_found = as.Date(c("2023-01-01", "2023-03-15", "2023-02-01", "2022-12-01"))
)

get_info_chene_last_truffe(dbtruffe = dbtruffe, theidoak = "123")
#>   idoak estimation weight date_found estim_js
#> 1   123          0      5 2023-03-15         
get_info_chene_last_truffe(dbtruffe = dbtruffe, theidoak = "123", filter_missing_info = TRUE)
#>   idoak estimation weight date_found            estim_js
#> 1   123          1     NA 2023-01-01 checked = 'checked'