herd_plot: herd_plot

View source: R/herd_plot.R

herd_plotR Documentation

herd_plot

Description

top is a small function to not just present the first rows

Usage

herd_plot(
  df,
  herd_no_character,
  start_date = NULL,
  end_date = NULL,
  format = "%Y-%m-%d",
  plotly_output = TRUE,
  alternative_herd_no_name = NULL
)

Arguments

df

master_tb dataset

herd_no_character

herd number

start_date

start date of plot search. Format, '%Y-%m-%d'. Default is NULL so all years are plotted.

end_date

end date of plot search. Format, '%Y-%m-%d'. Default is NULL so all years are plotted.

format

date format, Default: '%Y-%m-%d'

plotly_output

Decide whether plot output is static or interactive. Default is TRUE which returns interactive plotly graph.

alternative_herd_no_name

If you want to change the herd_no in title to something else.

Details

DETAILS

Value

returns new column in BD dataset.

Examples

## Not run: 
if(interactive()){
p <- herd_plot(master_tb, "x1234567")
p
p <- herd_plot(master_tb, "x1234567", start_date = "2010-01-01")
p
p <- herd_plot(master_tb, "x1234567", plotly_output = FALSE) #static plot
p
p <- herd_plot(master_tb, "x1234567", plotly_output = FALSE, alternative_herd_no_name = "other name/number")
p
 }

## End(Not run)

044mj/cvera documentation built on Feb. 13, 2023, 10:02 p.m.