rcosmo (version 1.1.2)

coords<-.data.frame: Assign new coordinate system to a data.frame

Description

Assign new coordinate system to a data.frame

Usage

# S3 method for data.frame
coords(x, ...) <- value

Arguments

See Also

coords.data.frame

Examples

Run this code
# NOT RUN {
## Create df with no coords, then create df2 with cartesian coords
df <- data.frame(x = c(1,0,0), y = c(0,1,0), z = c(0,0,1))
df2 <- coords(df, new.coords = "cartesian")
df2
df

## Change the coords of df directly (to spherical)
coords(df) <- "spherical"
df

# }

Run the code above in your browser using DataCamp Workspace