This method creates a dataframe from the output of fgeo.krig::krig() (which is a list of class "krig_lst").

# S3 method for krig_lst
as_tibble(x, .id = "var", item = "df", ...)

# S3 method for krig_lst
as.data.frame(x, row.names = NULL, optional = FALSE,
  .id = "var", item = "df", ...)

Arguments

x

The output of fgeo.krig::krig().`

.id

Name for the column to hold soil variable-names.

item

Character string; either "df" or "df.poly".

...

Arguments passed to the base::as.data.frame() (not used in as_tibble.krig_lst()).

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method.

Value

A dataframe.

See also

Examples

vars <- c("c", "p") krig <- krig(soil_fake, vars, quiet = TRUE)
#> Guessing: plotdim = c(1000, 460)
as_tibble(krig)
#> # A tibble: 2,300 x 4 #> var x y z #> <chr> <dbl> <dbl> <dbl> #> 1 c 10 10 2.13 #> 2 c 30 10 2.12 #> 3 c 50 10 2.10 #> 4 c 70 10 2.09 #> 5 c 90 10 2.07 #> 6 c 110 10 2.06 #> 7 c 130 10 2.04 #> 8 c 150 10 2.03 #> 9 c 170 10 2.01 #> 10 c 190 10 2.00 #> # … with 2,290 more rows
head(as.data.frame(krig, stringsAsFactors = FALSE))
#> var x y z #> 1 c 10 10 2.134696 #> 2 c 30 10 2.119651 #> 3 c 50 10 2.104591 #> 4 c 70 10 2.089517 #> 5 c 90 10 2.074427 #> 6 c 110 10 2.059322