Landed catch by fleet and year table

table_landings(
  dat,
  unit_label = NULL,
  era = NULL,
  interactive = TRUE,
  group = NULL,
  method = "sum",
  module = NULL,
  label = NULL,
  digits = 2,
  scale_amount = 1,
  make_rda = FALSE,
  tables_dir = getwd()
)

Arguments

dat

Data frame or list. A tibble or named list of tibbles (input as list()) returned from convert_output.

If inputting a list of tibbles, the first tibble's reference point defined in ref_line is used to plot a reference line or calculate relative spawning biomass.

unit_label

String. Abbreviated landings units

Default: NULL

era

String. Era of data.

Default: "time"

Options: "early", "time", "fore" (forecast), or NULL (all data)

interactive

Logical. TRUE/FALSE; indicate whether the environment is interactive.

Default: FALSE

group

String. Single column that groups the data.

Set group = "none" to summarize data over all indexing values.

Default: NULL Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL

method

String. Method for summarizing data when group is set to "none".

Default: "sum"

Options: "sum" or "mean"

module

Character vector. (Optional) Module name found in dat$module_name. If selecting >1 module, place them in a vector like c("module1", "module2").

Default: NULL

If the interactive and >1 module_name is found, user will select the module_name in the console. @seealso filter_data()

label

String or vector of strings. The labels in the "label" column of dat to tabulate (e.g., "landings_predicted_weight"). If unspecified, the observed landings are used: the first of "landings_observed", "landings_observed_weight", "landings_observed_numbers", or "catch" (when dat also has "catch_predicted"), as in plot_landings(). When dat has none of these, the first label containing "landings" is used, with a message.

Default: NULL

digits

Number. Numeric value indicating the number of digits values in the table will be rounded to.

Default: 2

scale_amount

Number. A number to scale the y-axis values. If > 1, the magnitude of the scale amount will be added to the unit label (e.g. scale_amount = 1000 with a unit label of "1000s of lbs" will result in "thousands of 1000s of lbs")

Default: 1

make_rda

Logical. TRUE/FALSE; indicate whether to save the object and make an automated caption and alternative text in the form of an rda object. If TRUE, the rda will be exported to the folder indicated in the argument "figures_dir".

Default: FALSE.

tables_dir

Path. The location of the folder containing the generated table rda files ("tables") that will be created if the argument make_rda = TRUE.

Default: the working directory (getwd())

Value

A table ready of landed catch by fleet and year.

Details

The input is from an assessment model output file translated to a standardized output (convert_output). There are options to return a gt::gt() object or export an rda object containing a gt-based table, caption, and LaTeX-based table.

Examples

table_landings(stockplotr::example_data,
  interactive = FALSE
)
Year Landings Observed Weight North (kg) (se) Landings Observed Weight South (kg) (se)
1876 0.00 (0.01) 1.00 (0.01)
1877 0.00 (0.01) 1.00 (0.01)
1878 0.00 (0.01) 1.00 (0.01)
1879 0.00 (0.01) 1.00 (0.01)
1880 0.00 (0.01) 11.55 (0.01)
1881 0.00 (0.01) 22.10 (0.01)
1882 0.00 (0.01) 32.65 (0.01)
1883 0.00 (0.01) 43.20 (0.01)
1884 0.00 (0.01) 53.75 (0.01)
1885 0.00 (0.01) 64.30 (0.01)
1886 0.00 (0.01) 74.85 (0.01)
1887 0.00 (0.01) 85.40 (0.01)
1888 0.00 (0.01) 95.95 (0.01)
1889 0.00 (0.01) 106.50 (0.01)
1890 0.00 (0.01) 117.05 (0.01)
1891 0.00 (0.01) 127.60 (0.01)
1892 0.00 (0.01) 138.15 (0.01)
1893 0.00 (0.01) 148.71 (0.01)
1894 0.00 (0.01) 159.26 (0.01)
1895 0.00 (0.01) 169.81 (0.01)
1896 0.24 (0.01) 180.36 (0.01)
1897 0.20 (0.01) 190.91 (0.01)
1898 0.15 (0.01) 201.46 (0.01)
1899 0.15 (0.01) 212.01 (0.01)
1900 0.15 (0.01) 222.56 (0.01)
1901 0.14 (0.01) 233.11 (0.01)
1902 0.14 (0.01) 243.66 (0.01)
1903 0.13 (0.01) 254.21 (0.01)
1904 0.13 (0.01) 264.76 (0.01)
1905 0.13 (0.01) 275.31 (0.01)
1906 0.12 (0.01) 285.86 (0.01)
1907 0.12 (0.01) 296.41 (0.01)
1908 0.11 (0.01) 306.96 (0.01)
1909 0.11 (0.01) 317.51 (0.01)
1910 0.10 (0.01) 328.06 (0.01)
1911 0.10 (0.01) 338.61 (0.01)
1912 0.10 (0.01) 349.16 (0.01)
1913 0.09 (0.01) 359.71 (0.01)
1914 0.09 (0.01) 370.26 (0.01)
1915 0.08 (0.01) 380.81 (0.01)
1916 0.08 (0.01) 386.42 (0.01)
1917 0.08 (0.01) 526.41 (0.01)
1918 0.07 (0.01) 423.85 (0.01)
1919 0.07 (0.01) 333.44 (0.01)
1920 0.06 (0.01) 230.49 (0.01)
1921 0.06 (0.01) 293.76 (0.01)
1922 0.05 (0.01) 424.78 (0.01)
1923 0.05 (0.01) 427.36 (0.01)
1924 0.05 (0.01) 532.86 (0.01)
1925 0.04 (0.01) 528.47 (0.01)
1926 0.04 (0.01) 521.67 (0.01)
1927 0.04 (0.01) 632.04 (0.01)
1928 0.00 (0.01) 620.09 (0.01)
1929 1.54 (0.01) 706.04 (0.01)
1930 1.22 (0.01) 658.83 (0.01)
1931 17.17 (0.01) 623.93 (0.01)
1932 41.73 (0.01) 556.66 (0.01)
1933 54.42 (0.01) 424.32 (0.01)
1934 68.97 (0.01) 1,110.98 (0.01)
1935 86.80 (0.01) 895.44 (0.01)
1936 115.33 (0.01) 510.98 (0.01)
1937 198.06 (0.01) 817.70 (0.01)
1938 134.64 (0.01) 989.10 (0.01)
1939 374.27 (0.01) 1,160.51 (0.01)
1940 602.24 (0.01) 714.63 (0.01)
1941 771.51 (0.01) 405.25 (0.01)
1942 1,928.65 (0.01) 277.41 (0.01)
1943 1,959.02 (0.01) 416.86 (0.01)
1944 1,111.90 (0.01) 509.50 (0.01)
1945 973.80 (0.01) 534.46 (0.01)
1946 1,596.12 (0.01) 1,209.41 (0.01)
1947 885.76 (0.01) 1,336.82 (0.01)
1948 1,971.81 (0.01) 2,308.64 (0.01)
1949 822.94 (0.01) 2,246.26 (0.01)
1950 1,480.79 (0.01) 1,980.46 (0.01)
1951 1,084.95 (0.01) 1,238.49 (0.01)
1952 864.21 (0.01) 1,312.51 (0.01)
1953 414.09 (0.01) 1,514.08 (0.01)
1954 634.02 (0.01) 1,891.97 (0.01)
1955 652.60 (0.01) 1,641.72 (0.01)
1956 571.36 (0.01) 1,277.89 (0.01)
1957 1,051.75 (0.01) 1,587.99 (0.01)
1958 890.87 (0.01) 1,427.80 (0.01)
1959 686.92 (0.01) 1,194.06 (0.01)
1960 1,034.52 (0.01) 1,122.94 (0.01)
1961 1,010.41 (0.01) 1,538.01 (0.01)
1962 1,311.39 (0.01) 1,379.45 (0.01)
1963 1,205.57 (0.01) 1,504.99 (0.01)
1964 927.02 (0.01) 1,223.64 (0.01)
1965 901.65 (0.01) 1,207.58 (0.01)
1966 961.76 (0.01) 1,327.75 (0.01)
1967 925.63 (0.01) 1,255.79 (0.01)
1968 817.32 (0.01) 1,303.81 (0.01)
1969 948.66 (0.01) 1,300.34 (0.01)
1970 1,164.62 (0.01) 1,549.34 (0.01)
1971 1,314.18 (0.01) 1,573.50 (0.01)
1972 1,331.65 (0.01) 1,621.70 (0.01)
1973 1,645.58 (0.01) 1,304.98 (0.01)
1974 2,068.70 (0.01) 1,556.13 (0.01)
1975 2,006.61 (0.01) 1,483.24 (0.01)
1976 1,413.47 (0.01) 1,350.59 (0.01)
1977 1,269.72 (0.01) 998.22 (0.01)
1978 1,864.01 (0.01) 1,194.78 (0.01)
1979 1,666.00 (0.01) 1,388.97 (0.01)
1980 1,401.60 (0.01) 1,066.00 (0.01)
1981 1,236.04 (0.01) 805.15 (0.01)
1982 1,838.53 (0.01) 791.80 (0.01)
1983 1,630.29 (0.01) 583.90 (0.01)
1984 1,148.63 (0.01) 590.54 (0.01)
1985 982.89 (0.01) 856.56 (0.01)
1986 1,024.00 (0.01) 726.43 (0.01)
1987 1,381.18 (0.01) 823.66 (0.01)
1988 1,354.06 (0.01) 795.12 (0.01)
1989 1,312.07 (0.01) 840.63 (0.01)
1990 1,086.22 (0.01) 678.42 (0.01)
1991 1,192.57 (0.01) 734.80 (0.01)
1992 1,021.46 (0.01) 532.04 (0.01)
1993 1,039.69 (0.01) 463.52 (0.01)
1994 825.58 (0.01) 549.56 (0.01)
1995 1,066.33 (0.01) 592.72 (0.01)
1996 1,010.33 (0.01) 818.27 (0.01)
1997 1,113.93 (0.01) 833.79 (0.01)
1998 989.95 (0.01) 472.82 (0.01)
1999 931.30 (0.01) 565.81 (0.01)
2000 1,253.23 (0.01) 640.04 (0.01)
2001 1,270.22 (0.01) 575.00 (0.01)
2002 1,317.36 (0.01) 479.73 (0.01)
2003 1,661.17 (0.01) 408.41 (0.01)
2004 1,471.05 (0.01) 492.92 (0.01)
2005 1,970.53 (0.01) 763.83 (0.01)
2006 1,858.41 (0.01) 751.79 (0.01)
2007 1,333.54 (0.01) 919.30 (0.01)
2008 1,294.91 (0.01) 924.80 (0.01)
2009 1,236.74 (0.01) 530.70 (0.01)
2010 589.72 (0.01) 213.38 (0.01)
2011 757.01 (0.01) 177.50 (0.01)
2012 896.27 (0.01) 221.45 (0.01)
2013 1,776.22 (0.01) 477.14 (0.01)
2014 1,783.41 (0.01) 625.33 (0.01)
2015 2,085.62 (0.01) 579.55 (0.01)
2016 2,254.21 (0.01) 473.42 (0.01)
2017 2,313.91 (0.01) 616.71 (0.01)
2018 2,284.80 (0.01) 609.64 (0.01)
2019 2,079.95 (0.01) 536.96 (0.01)
2020 1,548.72 (0.01) 543.41 (0.01)
2021 2,103.03 (0.01) 776.08 (0.01)
2022 2,093.58 (0.01) 966.36 (0.01)
table_landings( stockplotr::example_data, unit_label = "kg", group = "fleet" )
Year Landings Observed Weight North (kg) (se) Landings Observed Weight South (kg) (se)
1876 0.00 (0.01) 1.00 (0.01)
1877 0.00 (0.01) 1.00 (0.01)
1878 0.00 (0.01) 1.00 (0.01)
1879 0.00 (0.01) 1.00 (0.01)
1880 0.00 (0.01) 11.55 (0.01)
1881 0.00 (0.01) 22.10 (0.01)
1882 0.00 (0.01) 32.65 (0.01)
1883 0.00 (0.01) 43.20 (0.01)
1884 0.00 (0.01) 53.75 (0.01)
1885 0.00 (0.01) 64.30 (0.01)
1886 0.00 (0.01) 74.85 (0.01)
1887 0.00 (0.01) 85.40 (0.01)
1888 0.00 (0.01) 95.95 (0.01)
1889 0.00 (0.01) 106.50 (0.01)
1890 0.00 (0.01) 117.05 (0.01)
1891 0.00 (0.01) 127.60 (0.01)
1892 0.00 (0.01) 138.15 (0.01)
1893 0.00 (0.01) 148.71 (0.01)
1894 0.00 (0.01) 159.26 (0.01)
1895 0.00 (0.01) 169.81 (0.01)
1896 0.24 (0.01) 180.36 (0.01)
1897 0.20 (0.01) 190.91 (0.01)
1898 0.15 (0.01) 201.46 (0.01)
1899 0.15 (0.01) 212.01 (0.01)
1900 0.15 (0.01) 222.56 (0.01)
1901 0.14 (0.01) 233.11 (0.01)
1902 0.14 (0.01) 243.66 (0.01)
1903 0.13 (0.01) 254.21 (0.01)
1904 0.13 (0.01) 264.76 (0.01)
1905 0.13 (0.01) 275.31 (0.01)
1906 0.12 (0.01) 285.86 (0.01)
1907 0.12 (0.01) 296.41 (0.01)
1908 0.11 (0.01) 306.96 (0.01)
1909 0.11 (0.01) 317.51 (0.01)
1910 0.10 (0.01) 328.06 (0.01)
1911 0.10 (0.01) 338.61 (0.01)
1912 0.10 (0.01) 349.16 (0.01)
1913 0.09 (0.01) 359.71 (0.01)
1914 0.09 (0.01) 370.26 (0.01)
1915 0.08 (0.01) 380.81 (0.01)
1916 0.08 (0.01) 386.42 (0.01)
1917 0.08 (0.01) 526.41 (0.01)
1918 0.07 (0.01) 423.85 (0.01)
1919 0.07 (0.01) 333.44 (0.01)
1920 0.06 (0.01) 230.49 (0.01)
1921 0.06 (0.01) 293.76 (0.01)
1922 0.05 (0.01) 424.78 (0.01)
1923 0.05 (0.01) 427.36 (0.01)
1924 0.05 (0.01) 532.86 (0.01)
1925 0.04 (0.01) 528.47 (0.01)
1926 0.04 (0.01) 521.67 (0.01)
1927 0.04 (0.01) 632.04 (0.01)
1928 0.00 (0.01) 620.09 (0.01)
1929 1.54 (0.01) 706.04 (0.01)
1930 1.22 (0.01) 658.83 (0.01)
1931 17.17 (0.01) 623.93 (0.01)
1932 41.73 (0.01) 556.66 (0.01)
1933 54.42 (0.01) 424.32 (0.01)
1934 68.97 (0.01) 1,110.98 (0.01)
1935 86.80 (0.01) 895.44 (0.01)
1936 115.33 (0.01) 510.98 (0.01)
1937 198.06 (0.01) 817.70 (0.01)
1938 134.64 (0.01) 989.10 (0.01)
1939 374.27 (0.01) 1,160.51 (0.01)
1940 602.24 (0.01) 714.63 (0.01)
1941 771.51 (0.01) 405.25 (0.01)
1942 1,928.65 (0.01) 277.41 (0.01)
1943 1,959.02 (0.01) 416.86 (0.01)
1944 1,111.90 (0.01) 509.50 (0.01)
1945 973.80 (0.01) 534.46 (0.01)
1946 1,596.12 (0.01) 1,209.41 (0.01)
1947 885.76 (0.01) 1,336.82 (0.01)
1948 1,971.81 (0.01) 2,308.64 (0.01)
1949 822.94 (0.01) 2,246.26 (0.01)
1950 1,480.79 (0.01) 1,980.46 (0.01)
1951 1,084.95 (0.01) 1,238.49 (0.01)
1952 864.21 (0.01) 1,312.51 (0.01)
1953 414.09 (0.01) 1,514.08 (0.01)
1954 634.02 (0.01) 1,891.97 (0.01)
1955 652.60 (0.01) 1,641.72 (0.01)
1956 571.36 (0.01) 1,277.89 (0.01)
1957 1,051.75 (0.01) 1,587.99 (0.01)
1958 890.87 (0.01) 1,427.80 (0.01)
1959 686.92 (0.01) 1,194.06 (0.01)
1960 1,034.52 (0.01) 1,122.94 (0.01)
1961 1,010.41 (0.01) 1,538.01 (0.01)
1962 1,311.39 (0.01) 1,379.45 (0.01)
1963 1,205.57 (0.01) 1,504.99 (0.01)
1964 927.02 (0.01) 1,223.64 (0.01)
1965 901.65 (0.01) 1,207.58 (0.01)
1966 961.76 (0.01) 1,327.75 (0.01)
1967 925.63 (0.01) 1,255.79 (0.01)
1968 817.32 (0.01) 1,303.81 (0.01)
1969 948.66 (0.01) 1,300.34 (0.01)
1970 1,164.62 (0.01) 1,549.34 (0.01)
1971 1,314.18 (0.01) 1,573.50 (0.01)
1972 1,331.65 (0.01) 1,621.70 (0.01)
1973 1,645.58 (0.01) 1,304.98 (0.01)
1974 2,068.70 (0.01) 1,556.13 (0.01)
1975 2,006.61 (0.01) 1,483.24 (0.01)
1976 1,413.47 (0.01) 1,350.59 (0.01)
1977 1,269.72 (0.01) 998.22 (0.01)
1978 1,864.01 (0.01) 1,194.78 (0.01)
1979 1,666.00 (0.01) 1,388.97 (0.01)
1980 1,401.60 (0.01) 1,066.00 (0.01)
1981 1,236.04 (0.01) 805.15 (0.01)
1982 1,838.53 (0.01) 791.80 (0.01)
1983 1,630.29 (0.01) 583.90 (0.01)
1984 1,148.63 (0.01) 590.54 (0.01)
1985 982.89 (0.01) 856.56 (0.01)
1986 1,024.00 (0.01) 726.43 (0.01)
1987 1,381.18 (0.01) 823.66 (0.01)
1988 1,354.06 (0.01) 795.12 (0.01)
1989 1,312.07 (0.01) 840.63 (0.01)
1990 1,086.22 (0.01) 678.42 (0.01)
1991 1,192.57 (0.01) 734.80 (0.01)
1992 1,021.46 (0.01) 532.04 (0.01)
1993 1,039.69 (0.01) 463.52 (0.01)
1994 825.58 (0.01) 549.56 (0.01)
1995 1,066.33 (0.01) 592.72 (0.01)
1996 1,010.33 (0.01) 818.27 (0.01)
1997 1,113.93 (0.01) 833.79 (0.01)
1998 989.95 (0.01) 472.82 (0.01)
1999 931.30 (0.01) 565.81 (0.01)
2000 1,253.23 (0.01) 640.04 (0.01)
2001 1,270.22 (0.01) 575.00 (0.01)
2002 1,317.36 (0.01) 479.73 (0.01)
2003 1,661.17 (0.01) 408.41 (0.01)
2004 1,471.05 (0.01) 492.92 (0.01)
2005 1,970.53 (0.01) 763.83 (0.01)
2006 1,858.41 (0.01) 751.79 (0.01)
2007 1,333.54 (0.01) 919.30 (0.01)
2008 1,294.91 (0.01) 924.80 (0.01)
2009 1,236.74 (0.01) 530.70 (0.01)
2010 589.72 (0.01) 213.38 (0.01)
2011 757.01 (0.01) 177.50 (0.01)
2012 896.27 (0.01) 221.45 (0.01)
2013 1,776.22 (0.01) 477.14 (0.01)
2014 1,783.41 (0.01) 625.33 (0.01)
2015 2,085.62 (0.01) 579.55 (0.01)
2016 2,254.21 (0.01) 473.42 (0.01)
2017 2,313.91 (0.01) 616.71 (0.01)
2018 2,284.80 (0.01) 609.64 (0.01)
2019 2,079.95 (0.01) 536.96 (0.01)
2020 1,548.72 (0.01) 543.41 (0.01)
2021 2,103.03 (0.01) 776.08 (0.01)
2022 2,093.58 (0.01) 966.36 (0.01)