cord_setting: setting coordinates

Description Usage Arguments Value Examples

View source: R/cord_setting.R

Description

This function sets four coordinates (x and y) for each horizon. This makes it easy to calculate a polygon. e.g. as Simple Features

Usage

1
cord_setting(df, plot_width = 3)

Arguments

df

A dataframe, which was normaly build by the function data_mod. The rows represent the horizons and the columns the properties. The data frame should contain at least one column with an id ("name"). One column with the mininal depth ("from1") and one with the maximum depth ("to1")

plot_width

A numeric value that sets the relative width of the plot. The default is 3

Value

This function returns a dataframe with four coordinates for each horizon. Additionally a column with the ID, which can be joind to the source data

Examples

1
2
3
4
5
6
data_example <- data.frame(name = c(1, 2), 
                           from1 = c(0,20), 
                           to1 = c(20, 40))

cord_example <- cord_setting(data_example, plot_width = 3)
print(cord_example)

nardusstricta/soilprofile2 documentation built on May 23, 2019, 6:04 p.m.