get_soils_list: Get the soil names for an usms.xml file

View source: R/get_soils_list.R

get_soils_listR Documentation

Get the soil names for an usms.xml file

Description

Extracts the soil names from a "usms.xml" file, or from a soil file

Usage

get_soils_list(
  file,
  soil = NULL,
  file_path = lifecycle::deprecated(),
  name = lifecycle::deprecated()
)

Arguments

file

Either the path of an usm file or of a soil file.

soil

Vector of soil names (or partial names). Optional, if not provided, the function returns the names of all the soils included in the given file.

file_path

[Deprecated] file_path is no longer supported, use file instead.

name

[Deprecated] name is no longer supported, use soil instead.

Details

The file given as the file_path is either a "usms" file type to get all the soils used in a particular USM, or a soil file type ("sols") to get all soil types available in a soil file.

Value

A vector of soil names

Examples

path <- get_examples_path(file_type = "xml")

# Read from a usms file (soils used in a USM):
soil_list <- get_soils_list(file = file.path(path, "usms.xml"))

# Read from a soil file (all soil types available in a soil file)
soil_list <- get_soils_list(file = file.path(path, "sols.xml"))

soil_list <- get_soils_list(file = file.path(path, "usms.xml"),
                            soil = c("solcanne", "sole"))

SticsRFiles documentation built on Sept. 12, 2024, 7:41 a.m.