record_grooming_rule | R Documentation |
record_grooming_rule
record_grooming_rule(
df,
index,
catch.col,
record = NULL,
rule,
year.col = NULL,
attribute = "catch",
keep_NA = T
)
df |
the df we are manipulating |
index |
a conditional index length(index) == nrow(df). TRUE means it stays, FALSE means it is being excluded from |
catch.col |
column label for the catch variable |
record |
a data.frame to append the summaries to. |
rule |
the label for the grooming rule (string) |
year.col |
column label for the year variable. Can be ommited, if supplied the Data.frame will break down catch and number of events removed from each grooming rule by year. |
attribute |
if by year specify the attribute to record
|
keep_NA |
if index has NA's and this is true then they stay in the data |
a utility function to record the effect of grooming rules on data sets. It will note remove the index from the dataset. TODO: As well as recording the effect of a groomong rule on catch and number of records summarise spatail distribution.
the record data frame with new entries for the grooming rule
## Not run:
## example of plotting this output
## plot records
melt_total = melt(total_grooming_record, id.vars = "rule")
melt_total$rule = factor(melt_total$rule, ordered = T, levels = total_grooming_record$rule)
ggplot(melt_total %>% filter(variable %in% c("events", "catch")),
aes(y = value /1000, x = rule, group = 1)) +
geom_line(size = 2, linetype = "dotted") +
geom_point(size = 4, aes(col = rule)) +
theme(axis.text.x = element_blank()) +
ylab("") +
ylim(0,1600) +
facet_wrap(~variable) +
xlab("")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.