prevR (version 3.3)

as.data.frame.prevR: Convert an object of class prevR into a data.frame.

Description

This function merges the slots clusters et rings of a object of class prevR.

Usage

# S3 method for prevR
as.data.frame(x, ..., N = NULL, R = NULL,
  clusters.only = FALSE)

Arguments

x

object of class prevR.

...

not used, for compatibility with the generic method as.data.frame.

N

integer or list of integers setting elements of rings to extract.

R

integer or list of integers setting elements of rings to extract.

clusters.only

return only the slot clusters of x?

Value

If clusters.only = TRUE, the function will return only the slot clusters of x.

Otherwise, slots clusters and rings of x will be merged in a unique data frame. The columns of rings will be renamed adding a suffix like .N300.RInf.

N and R define the elements of rings to extract. If not specified (NULL), all the elements of rings will be included.

See Also

as.data.frame{base}, prevR-class.

Examples

Run this code
# NOT RUN {
str(fdhs)
str(as.data.frame(fdhs))
# }
# NOT RUN {
 r.fdhs <- rings(fdhs, N=c(100,200,300))
 str(r.fdhs)
 str(as.data.frame(r.fdhs, clusters.only=TRUE))
 str(as.data.frame(r.fdhs))
 str(as.data.frame(r.fdhs, N=300))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab