Learn R Programming

biogeo (version 1.0)

renamefields: Rename particular fields in a dataframe

Description

Several functions require a particular set of columns in the dataframe with specific names. If the columns in the dataframe do not have these names then they can be renamed. The fields that can be renamed include: ID (unique identifiers), x (x-coordinate), y (y-coordinate), Species (the species names column)

Usage

renamefields(dat, ID = "ID", x = "x", y = "y", Species = "Species")

Arguments

dat
a dataframe containing the point records dataset
ID
the identifiers column
x
the x-coordinates (longitude) in decimal degrees
y
the y-coordinates (latitude) in decimal degrees
Species
the species names

Value

See Also

checkdatastr, addmainfields

Examples

Run this code
dat<-data.frame(places,Speciesnames="")
a<-renamefields(dat, ID = "id", x = "long", y = "lat", Species = "Speciesnames")

Run the code above in your browser using DataLab