Learn R Programming

astsa (version 2.1)

astsa.col: astsa color palette with transparency

Description

Modifies the opacity level of the astsa color palette.

Usage

astsa.col(col = 1, alpha = 1)

Value

a color vector using the astsa color palette at the chosen transparency level

Arguments

col

numerical vector representing colors (default is 1 or 'black') - see Examples

alpha

factor in [0,1] setting the opacity (default is 1)

Author

D.S.Stoffer

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.

Examples

Run this code
# plotting 2 series that touch (but in a nice way)
tsplot(cbind(gtemp_land, gtemp_ocean), col=astsa.col(c(4,2), .5), lwd=2, spaghetti=TRUE, 
         type='o', pch=20, ylab="Temperature Deviations")
legend('topleft', legend=c("Land Only", "Ocean Only"), col=c(4,2), lwd=2, pch=20, bty='n')  

# View the astsa palette
barplot(rep(1,8), col=1:8, main='astsa palette', names=1:8)

Run the code above in your browser using DataLab