-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
107 lines (76 loc) · 3.03 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# <img src="https://i.imgur.com/vTLlhbp.png" align="right" height=88 /> Import and manipulate ForestGEO data
<!-- badges: start -->
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![Coverage status](https://coveralls.io/repos/github/forestgeo/fgeo.tool/badge.svg)](https://coveralls.io/github/forestgeo/fgeo.tool)
[![CRAN status](https://www.r-pkg.org/badges/version/fgeo.tool)](https://cran.r-project.org/package=fgeo.tool)
[![R-CMD-check](https://github.com/forestgeo/fgeo.tool/workflows/R-CMD-check/badge.svg)](https://github.com/forestgeo/fgeo.tool/actions)
[![Codecov test coverage](https://codecov.io/gh/forestgeo/fgeo.tool/branch/main/graph/badge.svg)](https://app.codecov.io/gh/forestgeo/fgeo.tool?branch=main)
[![R-CMD-check](https://github.com/forestgeo/fgeo.tool/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/forestgeo/fgeo.tool/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
__fgeo.tool__ helps you to import and manipulate [ForestGEO](<https://forestgeo.si.edu/>) data.
## Installation
Install the latest stable version of **fgeo.tool** from CRAN with:
```R
install.packages("fgeo.tool")
```
Install the development version of **fgeo.tool** from GitHub with:
```R
# install.packages("devtools")
devtools::install_github("forestgeo/fgeo.tool")
```
Or [install all **fgeo** packages in one step](https://forestgeo.github.io/fgeo//index.html#installation).
## Example
```{r}
library(fgeo.tool)
# Helps access data for examples
library(fgeo.x)
```
`example_path()` allows you to access datasets stored in your R libraries.
```{r}
example_path()
(vft_file <- example_path("view/vft_4quad.csv"))
```
`read_vft()` and `read_taxa()` import a ViewFullTable and ViewTaxonomy from .tsv or .csv files.
```{r}
read_vft(vft_file)
```
`pick_dbh_under()`, `drop_status()` and friends pick and drop rows from a ForestGEO ViewFullTable or census table.
```{r}
tree5 <- fgeo.x::tree5
tree5 %>%
pick_dbh_under(100)
```
`pick_main_stem()` and `pick_main_stemid()` pick the main stem or main stemid(s) of each tree in each census.
```{r}
stem <- download_data("luquillo_stem6_random")
dim(stem)
dim(pick_main_stem(stem))
```
`add_status_tree()` adds the column status_tree based on the status of all stems of each tree.
```{r}
stem %>%
select(CensusID, treeID, stemID, status) %>%
add_status_tree()
```
`add_index()` and friends add columns to a ForestGEO-like dataframe.
```{r}
stem %>%
select(gx, gy) %>%
add_index()
```
[Get started with __fgeo__](https://forestgeo.github.io/fgeo/)
## Information
* [Getting help](https://forestgeo.github.io/fgeo.tool/SUPPORT.html).
* [Contributing](https://forestgeo.github.io/fgeo.tool/CONTRIBUTING.html).
* [Contributor Code of Conduct](https://forestgeo.github.io/fgeo.tool/CODE_OF_CONDUCT.html).