View source: R/CMBDataFrameGenerics.R
| coords.CMBDataFrame | R Documentation |
CMBDataFrameIf new.coords is unspecified then
this function returns the coordinate system used in the CMBDataFrame
cmbdf.
The coordinate system is either "cartesian" or "spherical".
If a new coordinate system is specified, using e.g.
new.coords = "spherical", then this function instead
returns a new CMBDataFrame whose coordinates are of the specified
type. The original CMBDataFrame, cmbdf, is unaffected.
If you would like to change cmbdf without creating a new
variable, then use coords<-.CMBDataFrame (see
examples below).
## S3 method for class 'CMBDataFrame' coords(x, new.coords, ...)
x |
A CMBDataFrame, |
new.coords |
Specifies the new coordinate system ("spherical" or "cartesian") if a change of coordinate system is desired. |
... |
Unused arguments. |
If new.coords is unspecified, then the name of the coordinate system
of cmbdf is returned. Otherwise a new CMBDataFrame is returned
equivalent to cmbdf but having the desired change of coordinates
## Create df with no coords, then create df2 with cartesian coords df <- CMBDataFrame(nside = 16) df coords(df) df2 <- coords(df, new.coords = "cartesian") coords(df2) ## Change the coords of df directly (to spherical) coords(df) <- "spherical" coords(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.