# NOT RUN {
## Create df with no coords, then create df2 with spherical coords
df <- data.frame(x = c(1,0,0), y = c(0,1,0), z = c(0,0,1))
df
df2 <- coords(df, new.coords = "spherical")
df2
## The function coords does not affect the original object.
## To change the coords assign a new value ("spherical or "cartesian")
coords(df, new.coords = "spherical")
df
coords(df) <- "spherical"
df
# }
Run the code above in your browser using DataLab