Skip to contents

Need to process detailed diet data first linux command line

Usage

est_trophic_level_time(
  param.dir =
    "C:/Users/andrew.beet/Documents/myWork/githubRepos/neus-atlantis/currentVersion",
  atl.dir = here::here("other/dev_3a75e57d1"),
  fgs = "neus_groups.csv",
  detDietfile = "DetDiet2.gz",
  timeRange = 1988:2017,
  plottl = F
)

Arguments

param.dir

Character String. Path to Parameter directory

atl.dir

Character String. Path to output directory

fgs

Character String. Name of groups.csv file

detDietfile

Character String. Name of processed zipped detailed diet file

timeRange

Vector

plottl

Boolean. Plot the Trophic level to window. Default = F

Value

list

trophiclevel

dataframe. Species, year, trophic level

figuretl

ggplot2 object. trophic level plots over time by species

zip up file

gzip -k neus_outputDetailedDietCheck.txt

then remove zeros and save ans another zip

zcat neus_outputDetailedDietCheck.txt.gz | awk 'NR > 1s=0; for (i=6;i<=NF;i++) s+=$i; if (s!=0)print' | gzip > DetDiet.gz

strip headers from original file

zcat neus_outputDetailedDietCheck.txt.gz | head -n1 | gzip > DetDietHead.gz

concatenate them

cat DetDietHead.gz DetDiet.gz > DetDiet2.gz