|
| 1 | + |
| 2 | +R version 4.4.2 (2024-10-31) -- "Pile of Leaves" |
| 3 | +Copyright (C) 2024 The R Foundation for Statistical Computing |
| 4 | +Platform: x86_64-pc-linux-gnu |
| 5 | + |
| 6 | +R is free software and comes with ABSOLUTELY NO WARRANTY. |
| 7 | +You are welcome to redistribute it under certain conditions. |
| 8 | +Type 'license()' or 'licence()' for distribution details. |
| 9 | + |
| 10 | + Natural language support but running in an English locale |
| 11 | + |
| 12 | +R is a collaborative project with many contributors. |
| 13 | +Type 'contributors()' for more information and |
| 14 | +'citation()' on how to cite R or R packages in publications. |
| 15 | + |
| 16 | +Type 'demo()' for some demos, 'help()' for on-line help, or |
| 17 | +'help.start()' for an HTML browser interface to help. |
| 18 | +Type 'q()' to quit R. |
| 19 | + |
| 20 | +> library(dplyr) |
| 21 | + |
| 22 | +Attaching package: 'dplyr' |
| 23 | + |
| 24 | +The following objects are masked from 'package:stats': |
| 25 | + |
| 26 | + filter, lag |
| 27 | + |
| 28 | +The following objects are masked from 'package:base': |
| 29 | + |
| 30 | + intersect, setdiff, setequal, union |
| 31 | + |
| 32 | +> library(tidyr) |
| 33 | +> library(pomp) |
| 34 | +> set.seed(1800076828) |
| 35 | +> ricker() -> po |
| 36 | +> options(pomp_archive_dir=tempdir()) |
| 37 | +> |
| 38 | +> simulate(po,nsim=20) |> |
| 39 | ++ coef() |> |
| 40 | ++ melt() |> |
| 41 | ++ pivot_wider() |> |
| 42 | ++ append_data("tmp.csv",overwrite=TRUE) |
| 43 | +> |
| 44 | +> simulate(po,nsim=20,times=1:3) |> |
| 45 | ++ as.data.frame() |> |
| 46 | ++ rename(.id=.L1) |> |
| 47 | ++ append_data("tmp.csv") -> dat |
| 48 | +> |
| 49 | +> data.table::fread(file.path(tempdir(),"tmp.csv")) -> dat1 |
| 50 | +> |
| 51 | +> stopifnot(all.equal(dat,dat1)) |
| 52 | +> |
| 53 | +> try(append_data("bob",file="tmp.csv")) |
| 54 | +Error : in 'append_data': Item 2 of input is not a data.frame, data.table or list |
| 55 | +> try(append_data("bob",file="tmp.csv",overwrite=TRUE)) |
| 56 | +Error : in 'append_data': is.list(x) is not TRUE |
| 57 | +> |
0 commit comments