-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommCatchforRecs.R
24 lines (17 loc) · 1 KB
/
CommCatchforRecs.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
setwd('c:/CloudStor/R_Stuff/AutoAssess')
## Manually choose .rdata file
myFile <- file.choose()
load(myFile)
getwd()
library(plyr)
library(xlsx)
blackaBdat <- subset(newBlackCE, fishdate >= '2014-11-01' & fishdate <= '2015-10-31')
blackcatch.ply <- ddply(blackaBdat, .(as.factor(new_zone), as.factor(blockno)), summarize, catch = sum(blips))
colnames(blackcatch.ply) <- c("zone","blockno","catch")
blackcatch.ply$Species <- "Blacklip"
write.xlsx(blackcatch.ply, "D:\\R_Stuff\\AutoAssess\\AbCatchdataForRecs.xlsx", sheetName="Blacklip", col.names=TRUE, row.names=TRUE, append=FALSE)
greenaBdat <- subset(newGreenCE, fishdate >= '2014-11-01' & fishdate <= '2015-10-31')
greencatch.ply <- ddply(greenaBdat, .(as.factor(zone), as.factor(blockno)), summarize, catch = sum(glips))
colnames(greencatch.ply) <- c("zone","blockno","catch")
greencatch.ply$Species <- "Greenlip"
write.xlsx(greencatch.ply, "D:\\R_Stuff\\AutoAssess\\AbCatchdataForRecs.xlsx", sheetName="Greenlip", col.names=TRUE, row.names=TRUE, append=TRUE)