---
title: "PEVS"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{PEVS}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

Loads information on the amount and value of the production of the exploitation of native plant resources and planted forest massifs, as well as existing total and harvested areas of forest crops.

Data is from the Silviculture and Forestry Extraction Production (PEVS, in Portuguese), a nationwide annual survey conducted by IBGE (Brazilian Institute of Geography and Statistics). The data also has multiple aggregation levels, such as nationwide, by region, mesoregion and microregion, as well as state and municipality. 

The data available has a yearly frequency and is available from 1986 to the present, with the exception of the data on total area for production, which are only available from 2013 onwards. More information can be found in [this link](https://www.ibge.gov.br/en/statistics/economic/agriculture-forestry-and-fishing/18374-forestry-activities.html?=&t=o-que-e).

***
**Options:**

  1. **dataset**: there are three choices:
      * `"pevs_forest_crops"`: provides data related to both quantity and value of the forestry activities. The data goes from 1986 to 2019 and it is divided by type of product.
      * `"pevs_silviculture"`: provides data related to both quantity and value of the silviculture. The data goes from 1986 to 2019 and it is divided by type of product.
      * `"pevs_silviculture_area"`: total existing area used for silviculture in 12/31.The data goes from 2013 to 2019 and it is divided by forestry species.  

  2. **raw_data**: there are two options:
      * `TRUE`: if you want the data as it is originally.
      * `FALSE`: if you want the treated version of the data. 
      
  3. **geo_level**: `"country"`, `"region"`, `"state"`, or `"municipality"`  
  
  4. **time_period**: picks the years for which the data will be downloaded

  5. **language**: you can choose between Portuguese `("pt")` and English `("eng")`
  
***

**Examples:**

```{r eval=FALSE}
# Download treated (raw_data = FALSE) silviculture data (dataset = 'pevs_silviculture')
# by state (geo_level = 'state') from 2012 (time_period =  2012)
# in portuguese (language = "pt")
data <- load_pevs(
  dataset = "pevs_silviculture",
  raw_data = FALSE,
  geo_level = "state",
  time_period = 2012,
  language = "pt"
)

# Download raw (raw_data = TRUE) forest crops data by region
# from 2012 to 2013 in english
data <- load_pevs(
  dataset = "pevs_forest_crops",
  raw_data = TRUE,
  geo_level = "region",
  time_period = 2012:2013
)
```
