Function to load various txt files from Atlantis simulations

load_txt(file, id_col = "Time")

Arguments

file

Character string giving the connection of the output file. The filename usually contains output and ends in .txt".

id_col

Character strings giving the names of the columns which are not variables. Data from all other columns will be gathered with tidyr. Default is "Time".

Value

Dataframe in tidy format!

See also

Examples

d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools") file <- file.path(d, "outputSETASSSB.txt") load_txt(file)
#> time code atoutput #> 1 0.0 FPS 1321.0301 #> 2 73.0 FPS 1318.3256 #> 3 146.0 FPS 1313.7675 #> 4 219.0 FPS 986.0235 #> 5 292.0 FPS 984.0646 #> 6 365.0 FPS 981.5988 #> 7 438.0 FPS 978.9368 #> 8 511.0 FPS 976.3568 #> 9 584.0 FPS 871.2670 #> 10 657.0 FPS 869.8744 #> 11 730.0 FPS 868.0674 #> 12 803.0 FPS 866.1898 #> 13 876.0 FPS 864.6107 #> 14 949.0 FPS 714.8117 #> 15 1022.0 FPS 714.1764 #> 16 1094.5 FPS 713.1989 #> 17 0.0 FVS 6593.2459 #> 18 73.0 FVS 6526.7663 #> 19 146.0 FVS 4215.3417 #> 20 219.0 FVS 3295.8986 #> 21 292.0 FVS 2771.0611 #> 22 365.0 FVS 2403.8153 #> 23 438.0 FVS 2574.0711 #> 24 511.0 FVS 2259.5360 #> 25 584.0 FVS 2049.1855 #> 26 657.0 FVS 1901.9129 #> 27 730.0 FVS 1778.8524 #> 28 803.0 FVS 1697.2225 #> 29 876.0 FVS 1581.8399 #> 30 949.0 FVS 1496.7472 #> 31 1022.0 FVS 1424.4647 #> 32 1094.5 FVS 1362.7012
file <- file.path(d, "outputSETASYOY.txt") load_txt(file)
#> time code atoutput #> 1 0.0 FPS.0 1.216909e+00 #> 2 73.0 FPS.0 1.216909e+00 #> 3 146.0 FPS.0 1.216909e+00 #> 4 219.0 FPS.0 7.238120e-01 #> 5 292.0 FPS.0 7.238120e-01 #> 6 365.0 FPS.0 7.238120e-01 #> 7 438.0 FPS.0 7.238120e-01 #> 8 511.0 FPS.0 7.238120e-01 #> 9 584.0 FPS.0 2.396000e-02 #> 10 657.0 FPS.0 2.396000e-02 #> 11 730.0 FPS.0 2.396000e-02 #> 12 803.0 FPS.0 2.396000e-02 #> 13 876.0 FPS.0 2.396000e-02 #> 14 949.0 FPS.0 9.377000e-03 #> 15 1022.0 FPS.0 9.377000e-03 #> 16 1094.5 FPS.0 9.377000e-03 #> 17 0.0 FVS.0 3.200440e+05 #> 18 73.0 FVS.0 6.948785e+05 #> 19 146.0 FVS.0 6.948785e+05 #> 20 219.0 FVS.0 6.948785e+05 #> 21 292.0 FVS.0 6.948785e+05 #> 22 365.0 FVS.0 6.948785e+05 #> 23 438.0 FVS.0 6.507030e+04 #> 24 511.0 FVS.0 6.507030e+04 #> 25 584.0 FVS.0 6.507030e+04 #> 26 657.0 FVS.0 6.507030e+04 #> 27 730.0 FVS.0 6.507030e+04 #> 28 803.0 FVS.0 5.328529e+04 #> 29 876.0 FVS.0 5.328529e+04 #> 30 949.0 FVS.0 5.328529e+04 #> 31 1022.0 FVS.0 5.328529e+04 #> 32 1094.5 FVS.0 5.328529e+04