Learn R Programming

quarrint (version 1.0.1)

as.data.frame.quarry: Coerce a Quarry to a Data Frame

Description

Coerce an object of type quarry to a data.frame. The attributes to be stored in the data frame can be specified (default: keeping every attributes).

Usage

# S3 method for quarry
as.data.frame(x, row.names = NULL, optional = NULL, 
              attr = "all", ...)

Value

A data frame with the columns listed in attr.

Arguments

x

An object of type quarry.

row.names

Not used.

optional

Not used.

attr

A vector listing the dummy variables to be retained in the data frame.

...

Further arguments passed to or from other methods.

Author

Johan Barthelemy.

Maintainer: Johan Barthelemy [email protected].

See Also

as.data.frame for the generic method.

Examples

Run this code
# creating a quarry
q <- quarry(geological.context = 2, hydrogeological.context = 4,
            piezometric.context = 1, quarry.position = 4,
            production.catchment = 4, quality.catchment = 3)

# coercing to a data frame
q.df <- as.data.frame(q)

# coercing to a data frame, keeping only "H1", "Z1" and "C2"
q.df.subset <- as.data.frame(q, attr = c("H1","Z1","C2"))

Run the code above in your browser using DataLab