To use this program, follow these steps:
# Package ID: knb-lter-vcr.16.3 Cataloging System:VCR.
# Data set title: A study of water quality conditions in the tidal creeks of Northampton County, Vs.
# Data set creator: Luis Lagera -
# Metadata Provider: - Virginia Coast Reserve Long-Term Ecological Research Project
# Contact: Dr Luis Lagera - -
# 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,"4X")
tmp_format <- c(tmp_format,"A8")
tmp_format <- c(tmp_format,"1X")
tmp_format <- c(tmp_format,"A5")
tmp_format <- c(tmp_format,"1X")
tmp_format <- c(tmp_format,"A3")
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"4X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"3X") F
tmp_format <- c(tmp_format,"2X") F
tmp_format <- c(tmp_format,"6X") F
tmp_format <- c(tmp_format,"1X")
tmp_format <- c(tmp_format,"A3")
tmp_format <- c(tmp_format,"5X") F
tmp_format <- c(tmp_format,"2X")
tmp_format <- c(tmp_format,"A3")
tmp_format <- c(tmp_format,"3X") F
tmp_format
tmp_cols <- c(
"DATE",
"TIME",
"SITEID",
"SCTT",
"SCTSL",
"SCTCO",
"MERCT",
"RSAL",
"DOT",
"DO",
"SCDEP",
"WDEP",
"WSPD",
"WDIR",
"AIRT",
"CLCOV",
"pH")
# 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 , "DATE")
tmp_label <- c(tmp_label , "date when meaurements were taken- ")
tmp_var <- c(tmp_var , "TIME")
tmp_label <- c(tmp_label , "time when measurements were taken- ")
tmp_var <- c(tmp_var , "SITEID")
tmp_label <- c(tmp_label , "site/station when measurements where taken- ")
tmp_var <- c(tmp_var , "SCTT")
tmp_label <- c(tmp_label , "water temperature- deg C")
tmp_var <- c(tmp_var , "SCTSL")
tmp_label <- c(tmp_label , "salinity (temperature compensated)- per 1000")
tmp_var <- c(tmp_var , "SCTCO")
tmp_label <- c(tmp_label , "conductivity of water sample- umhos/cm")
tmp_var <- c(tmp_var , "MERCT")
tmp_label <- c(tmp_label , "water temperature- deg C")
tmp_var <- c(tmp_var , "RSAL")
tmp_label <- c(tmp_label , "salinity- per 1000")
tmp_var <- c(tmp_var , "DOT")
tmp_label <- c(tmp_label , "water temperature- deg C")
tmp_var <- c(tmp_var , "DO")
tmp_label <- c(tmp_label , "dissolved oxygen- mg/l")
tmp_var <- c(tmp_var , "SCDEP")
tmp_label <- c(tmp_label , "Secchi disk depth- cm")
tmp_var <- c(tmp_var , "WDEP")
tmp_label <- c(tmp_label , "WDEP- none")
tmp_var <- c(tmp_var , "WSPD")
tmp_label <- c(tmp_label , "estimated wind speed- knots")
tmp_var <- c(tmp_var , "WDIR")
tmp_label <- c(tmp_label , "estimated wind direction- ")
tmp_var <- c(tmp_var , "AIRT")
tmp_label <- c(tmp_label , "air temperature- deg C")
tmp_var <- c(tmp_var , "CLCOV")
tmp_label <- c(tmp_label , "cloud cover- ")
tmp_var <- c(tmp_var , "pH")
tmp_label <- c(tmp_label , "pH of water sample- pH units")
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(DATE))
summary(as.factor(TIME))
summary(as.factor(SITEID))
summary(as.factor(WDIR))
summary(as.factor(CLCOV))
summary(as.numeric(SCTT))
summary(as.numeric(SCTSL))
summary(as.numeric(SCTCO))
summary(as.numeric(MERCT))
summary(as.numeric(RSAL))
summary(as.numeric(DOT))
summary(as.numeric(DO))
summary(as.numeric(SCDEP))
summary(as.numeric(WDEP))
summary(as.numeric(WSPD))
summary(as.numeric(AIRT))
summary(as.numeric(pH))