Learn R Programming

rysgran (version 2.1.0)

rysgran.hist: Histograms of Grain Size Data

Description

rysgran.hist generates histograms of weight percentage of phi classes for each grain size sample

Usage

rysgran.hist(data, subset = NULL, which = NULL, ordered = TRUE)

Arguments

data
a data matrix with grain size samples. Must contain the first line of grain size classes (logarithmic or geometric scale), each following line should contain the weights of a sample. No header should be used
subset
Vector whit factor to subset the histograms. Default is NULL
which
factor from subset object argument. Default is NULL
ordered
logical. If TRUE the panels order is on the order of row in tab, if FALSE the order is alphabetical. Default is TRUE

Value

Details

rysgran.hist is the only function in rysgran package which uses the package lattice. Users familiarized with lattice will have no problem using this function

See Also

rysgran.plot , gran.stats , rysgran.ternary , class.percent , lattice

Examples

Run this code

library(rysgran)
data(camargo2001)
data(sed.phi)

#histograms

rysgran.hist(camargo2001)


#histograms separated by factors

env<- rep(c("River","Tidal Flat","Subtidal","Beach"),each=10)
rysgran.hist(sed.phi, subset = env , which= "Subtidal")


#Making it more attractive

env<- rep(c("River","Tidal Flat","Subtidal","Beach"),each=10)
hist <- rysgran.hist(sed.phi, subset = env , which= "Subtidal")
hist

hist.up <- update(hist, aspect = .4,
    scales=list(x=list(cex=.7),y=list(cex=.7)),
    layout = c(2,5),
    between= list(x = c(0.2), y = c(0.2)),
    ylab = "Frequency",
    xlab = expression(paste(phi)),
    strip = strip.custom(bg = "lightblue"),
    col = "red",
    main="Histogram")
hist.up

Run the code above in your browser using DataLab