To use this program, follow these steps:
# Package ID: knb-lter-vcr.10.4 Cataloging System:VCR.
# Data set title: Hog and Cobb Island nesting seabird study, part A. 1990.
# Data set creator: Ruth Beck -
# Metadata Provider: - Virginia Coast Reserve Long-Term Ecological Research Project
# Contact: Dr. Linda Blum - - lkb2e@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,"A4")
tmp_format <- c(tmp_format,"3X")
tmp_format <- c(tmp_format,"A6")
tmp_format <- c(tmp_format,"3X")
tmp_format <- c(tmp_format,"A1")
tmp_format <- c(tmp_format,"3X")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"F2")
tmp_format <- c(tmp_format,"3X")
tmp_format <- c(tmp_format,"F4")
tmp_format
tmp_cols <- c(
"ISLAND",
"SPECID",
"AGE",
"MONTH",
"DAY",
"YEAR",
"COUNT")
# 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 , "ISLAND")
tmp_label <- c(tmp_label , "Island where doing bird censuses- ")
tmp_var <- c(tmp_var , "SPECID")
tmp_label <- c(tmp_label , "Species ID- ")
tmp_var <- c(tmp_var , "AGE")
tmp_label <- c(tmp_label , "Age of bird- ")
tmp_var <- c(tmp_var , "MONTH")
tmp_label <- c(tmp_label , "Month of census- MM")
tmp_var <- c(tmp_var , "DAY")
tmp_label <- c(tmp_label , "Day of census- DD")
tmp_var <- c(tmp_var , "YEAR")
tmp_label <- c(tmp_label , "Year of census- YY")
tmp_var <- c(tmp_var , "COUNT")
tmp_label <- c(tmp_label , "Numbers of birds or nests seen- none")
labelFrame1<-data.frame(variable=tmp_var, label=tmp_label)
rm(tmp_var, tmp_label)
tmp_var <- character()
tmp_code <- character()
tmp_label <- character()
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(ISLAND))
summary(as.factor(SPECID))
summary(as.factor(AGE))
summary(as.numeric(MONTH))
summary(as.numeric(DAY))
summary(as.numeric(YEAR))
summary(as.numeric(COUNT))