Skip to contents

Create the Sites table

Usage

create_sites(
  L0_flat,
  SiteCode,
  SiteName,
  Latitude,
  Longitude,
  LatLongDatumSRSName = NULL,
  Elevation_m = NULL,
  VerticalDatum = NULL,
  LocalX = NULL,
  LocalY = NULL,
  LocalProjectionSRSName = NULL,
  PosAccuracy_m = NULL,
  State = NULL,
  County = NULL,
  Comments = NULL,
  SiteType = NULL
)

Arguments

L0_flat

(tbl_df, tbl, data.frame) The fully joined source L0 dataset, in "flat" format (see details).

SiteCode

(character) Column in L0_flat containing the user or organization-defined code that collects the data to identify the site.

SiteName

(character) Column in L0_flat containing the full name of the sampling site.

Latitude

(character) Column in L0_flat containing the latitude in decimal degrees.

Longitude

(character) Column in L0_flat containing the longitude in decimal degrees.

LatLongDatumSRSName

(character) Column in L0_flat containing the The spatial reference system of the latitude and longitude coordinates. Choose an SRSName where IsGeographic=True from SpatialReferencesCV. View possible options with `SpatialReferencesCV$SRSName[SpatialReferencesCV$IsGeographic]`

Elevation_m

(character) Column in L0_flat containing the elevation of the sampling location in meters.

VerticalDatum

(character) Column in L0_flat containing the Vertical datum of the elevation. Choose a Term from the VerticalDatum controlled vocabulary.

LocalX

(character) Column in L0_flat containing the local projection X coordinate.

LocalY

(character) Column in L0_flat containing the local projection Y coordinate.

LocalProjectionSRSName

(character) Column in L0_flat containing the full text name of the spatial reference system of the local coordinates. This field is optional and is only necessary if local coordinates are given. Choose an SRSName from from SpatialReferencesCV.

PosAccuracy_m

(character) Column in L0_flat containing the value giving the accuracy with which the positional information is specified in meters.

State

(character) Column in L0_flat containing the name of state in which the monitoring site is located.

County

(character) Column in L0_flat containing the name of county in which monitoring site is located.

Comments

(character) Column in L0_flat containing the comments related to the site.

SiteType

(character) Column in L0_flat containing the the type of site. Choose a Term from SiteTypeCV.

Value

(tbl_df, tbl, data.frame) The Sites table.

Details

This function appends columns to the L0_flat table and returns the augmented table.

"flat" format refers to the fully joined source L0 dataset in "wide" form with the exception of the core observation variables, which are in "long" form (i.e. using the variable_name, value, unit columns of the observation table). This "flat" format is the "widest" an L1 hymetDP dataset can be consistently spread due to the frequent occurrence of L0 source datasets with > 1 core observation variable.

Examples


flat <- hymet_L0_flat

  Sites <- hymetDP::create_sites(
    L0_flat = flat,
    SiteCode = "SiteCode",
    SiteName = "SiteName",
    Latitude = "Latitude",
    Longitude = "Longitude",
    LatLongDatumSRSName = NULL,
    Elevation_m = NULL,
    VerticalDatum = NULL,
    LocalX = NULL,
    LocalY = NULL,
    LocalProjectionSRSName = NULL,
    PosAccuracy_m = NULL,
    State = NULL,
    County = NULL,
    Comments = NULL,
    SiteType = "SiteType")

  Sites
#> # A tibble: 1 × 15
#>   SiteCode SiteName              Latitude Longitude LatLongDatumSRS… Elevation_m
#>   <chr>    <chr>                    <dbl>     <dbl> <chr>                  <dbl>
#> 1 1        USGS site 9; coordin…    -77.6      163. Unknown                   NA
#> # … with 9 more variables: VerticalDatum <chr>, LocalX <dbl>, LocalY <dbl>,
#> #   LocalProjectionSRSName <chr>, PosAccuracy_m <dbl>, State <chr>,
#> #   County <chr>, Comments <chr>, SiteType <chr>