| Alfalfa {SASxport} | R Documentation |
This data set exists to provide an example file for lookup.xport() and read.xport()
data(Alfalfa)
A data frame with 40 observations on the following 6 variables.
POPMAX amd minSAMPLEREPSEEDWTHARV1HARV2
Population "MAX" has slightly higher harvest volumes (HARV1 and
HARV2) than population "min". (Surprise! Shock! Awe!)
The 'Alfalfa.xpt' file was obtained from the R 'foreign' package.
data(Alfalfa)
# go were the data is...
here <- getwd()
setwd(file.path(.path.package("SASxport"),"data"))
# Description of the file contents
lookup.xport("Alfalfa.xpt")
# Load the file contents
Alfalfa <- read.xport("Alfalfa.xpt")
head(Alfalfa)
# return home
setwd(here)
# Just for fun, plot the data
par(mfrow=c(1,2))
plot( HARV1 ~ POP, data=Alfalfa)
plot( HARV2 ~ POP, data=Alfalfa)