Learn R Programming

FREddyPro (version 1.0)

addSiteName: Create an extra column in a data frame with the name of the site

Description

Adds an extra column with the given string for each row in the data frame

Usage

addSiteName(data, name)

Arguments

data
The data frame
name
A string to write in the extra column, usually the name of the site e.g., "Harwood"

Value

Returns a column with character elements

Details

The function is useful if you need an identifier when combine data with different characteristics

Examples

Run this code
##Load the data
data(fluxes)

## Clean data
fluxes=cleanFluxes(fluxes,sdCor=TRUE,sdTimes=3,timesList=3,distCor=TRUE,
                   thresholdList=list(H=c(-100,1000),LE=c(-100,1000)))

## Add the name of the site
fluxes=addSiteName(fluxes,"Harwood")

Run the code above in your browser using DataLab