To use this program, follow these steps:
# Package ID: knb-lter-vcr.7.4 Cataloging System:VCR.
# Data set title: LTER hurricane record for the Virginia Coast Reserve..
# Data set creator: Dr. Bruce Hayden -
# Metadata Provider: - Virginia Coast Reserve Long-Term Ecological Research Project
# Contact: Dr. Bruce Hayden - - bph@virginia.edu
# Contact: Dr. Bruce Hayden - - bph@virginia.edu
# Contact: - Information manager - Virginia Coast Reserve Long-Term Ecological Research Project - jporter@lternet.edu
# You should replace 'PUT-LOCAL-PATH-TO-DATA-FILE-HERE' (below) with the appropriate path.
# to your data file (e.g., c:\mydata\datafile.txt).
infile1 <- file("PUT-LOCAL-PATH-TO-DATA-FILE-HERE", open="r")
tmp_format <- character()
tmp_format <- c(tmp_format,"F4")
tmp_format <- c(tmp_format,"5X")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"5X")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"5X")
tmp_format <- c(tmp_format,"A2")
tmp_format <- c(tmp_format,"4X")
tmp_format <- c(tmp_format,"A1")
tmp_format <- c(tmp_format,"5X")
tmp_format <- c(tmp_format,"A10")
tmp_format <- c(tmp_format,"3X")
tmp_format <- c(tmp_format,"A37")
tmp_format
tmp_cols <- c(
"YEAR",
"MONTH",
"DAY",
"CLASS",
"TRACK",
"CROSS",
"NAME")
# This creates a data.frame named: dataTable1
dataTable1 <-read.fortran(infile1,tmp_format, col.names=tmp_cols, check.names=TRUE,na.strings=c("NA","."))
rm(tmp_format, tmp_cols)
tmp_var <- character()
tmp_label <- character()
tmp_var <- c(tmp_var , "YEAR")
tmp_label <- c(tmp_label , "Year of occurence of the storm- none")
tmp_var <- c(tmp_var , "MONTH")
tmp_label <- c(tmp_label , "Month of occurrence of the storm- none")
tmp_var <- c(tmp_var , "DAY")
tmp_label <- c(tmp_label , "Day in the month the storm occurred- none")
tmp_var <- c(tmp_var , "CLASS")
tmp_label <- c(tmp_label , "Classification of the storm based on wind speed- ")
tmp_var <- c(tmp_var , "TRACK")
tmp_label <- c(tmp_label , "The path of the storm- ")
tmp_var <- c(tmp_var , "CROSS")
tmp_label <- c(tmp_label , "Coastal location of storm crossing- ")
tmp_var <- c(tmp_var , "NAME")
tmp_label <- c(tmp_label , "Name of the storm- ")
labelFrame1<-data.frame(variable=tmp_var, label=tmp_label)
rm(tmp_var, tmp_label)
tmp_var <- character()
tmp_code <- character()
tmp_label <- character()
tmp_var <- c(tmp_var,"CLASS")
tmp_code <- c(tmp_code,"EX")
tmp_label <- c(tmp_label,"Extratropical - No longer a tropical storm (associated with fronts)")
tmp_var <- c(tmp_var,"CLASS")
tmp_code <- c(tmp_code,"H")
tmp_label <- c(tmp_label,"Hurricane (72 mph or greater)")
tmp_var <- c(tmp_var,"CLASS")
tmp_code <- c(tmp_code,"TS")
tmp_label <- c(tmp_label,"Tropical Storm (less than 72 miles per hour)")
tmp_var <- c(tmp_var,"TRACK")
tmp_code <- c(tmp_code,"A")
tmp_label <- c(tmp_label,"Along the shore track. Produces storm surge.")
tmp_var <- c(tmp_var,"TRACK")
tmp_code <- c(tmp_code,"I")
tmp_label <- c(tmp_label,"Inland of Virginia Coast Reserve")
tmp_var <- c(tmp_var,"TRACK")
tmp_code <- c(tmp_code,"L")
tmp_label <- c(tmp_label,"Landfall: produces storm surge")
tmp_var <- c(tmp_var,"TRACK")
tmp_code <- c(tmp_code,"O")
tmp_label <- c(tmp_label,"Track Offshore: little storm surge if any")
codeLabelFrame1 <- data.frame(variable=tmp_var, code=tmp_code, label=tmp_label)
rm(tmp_var, tmp_label, tmp_code)
# HERE IS A LIST OF VARIABLES from dataTable1 AND LABELS FOR THOSE VARIABLES
labelFrame1
# HERE IS A LIST OF VARIABLES TO WHICH CODES HAD BEEN ASSIGNED
codeLabelFrame1
attach(dataTable1)
# The analyses below are basic descriptions of the variables. After testing, they should be replaced.
summary(as.factor(CLASS))
summary(as.factor(TRACK))
summary(as.factor(CROSS))
summary(as.factor(NAME))
summary(as.numeric(YEAR))
summary(as.numeric(MONTH))
summary(as.numeric(DAY))