R/makeGSHYD.r

makeGSHYD <- function(x) {
	#x comes from compileODF.r
	bioLibrary( "bio.groundfish", "bio.bathymetry" )
	gshyd <- x[,c('mission','setno','temperature_ITS-68,degC_-99', 'salinity_PSU_-99' ,'oxygen_by_volume_ml/l_-99','depth')]
	gshyd$gear <- 2
	gshyd$eind <- NA
	gshyd$tagno <- NA
	gshyd$bid  <- NA
	names(gshyd)[1:6] <- c('mission','setno','temp','sal','oxyml','sdepth')
	idx <- sapply(split(1:nrow(gshyd), gshyd$setno), function(x) { x[which.max(gshyd[x,"sdepth"])]})
	gshyd$bid[idx] <- 'B'
	gshyd$year <- substring(gshyd$mission,4,7)
	return(gshyd)
}
AtlanticR/bio.groundfish documentation built on May 28, 2019, 11:05 a.m.