-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
163 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
library(dplyr) | ||
library(tidyr) | ||
library(pomp) | ||
set.seed(1800076828) | ||
ricker() -> po | ||
options(pomp_archive_dir=tempdir()) | ||
|
||
simulate(po,nsim=20) |> | ||
coef() |> | ||
melt() |> | ||
pivot_wider() |> | ||
append_data("tmp.csv",overwrite=TRUE) | ||
|
||
simulate(po,nsim=20,times=1:3) |> | ||
as.data.frame() |> | ||
rename(.id=.L1) |> | ||
append_data("tmp.csv") -> dat | ||
|
||
data.table::fread(file.path(tempdir(),"tmp.csv")) -> dat1 | ||
|
||
stopifnot(all.equal(dat,dat1)) | ||
|
||
try(append_data("bob",file="tmp.csv")) | ||
try(append_data("bob",file="tmp.csv",overwrite=TRUE)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
R version 4.4.2 (2024-10-31) -- "Pile of Leaves" | ||
Copyright (C) 2024 The R Foundation for Statistical Computing | ||
Platform: x86_64-pc-linux-gnu | ||
|
||
R is free software and comes with ABSOLUTELY NO WARRANTY. | ||
You are welcome to redistribute it under certain conditions. | ||
Type 'license()' or 'licence()' for distribution details. | ||
|
||
Natural language support but running in an English locale | ||
|
||
R is a collaborative project with many contributors. | ||
Type 'contributors()' for more information and | ||
'citation()' on how to cite R or R packages in publications. | ||
|
||
Type 'demo()' for some demos, 'help()' for on-line help, or | ||
'help.start()' for an HTML browser interface to help. | ||
Type 'q()' to quit R. | ||
|
||
> library(dplyr) | ||
|
||
Attaching package: 'dplyr' | ||
|
||
The following objects are masked from 'package:stats': | ||
|
||
filter, lag | ||
|
||
The following objects are masked from 'package:base': | ||
|
||
intersect, setdiff, setequal, union | ||
|
||
> library(tidyr) | ||
> library(pomp) | ||
> set.seed(1800076828) | ||
> ricker() -> po | ||
> options(pomp_archive_dir=tempdir()) | ||
> | ||
> simulate(po,nsim=20) |> | ||
+ coef() |> | ||
+ melt() |> | ||
+ pivot_wider() |> | ||
+ append_data("tmp.csv",overwrite=TRUE) | ||
> | ||
> simulate(po,nsim=20,times=1:3) |> | ||
+ as.data.frame() |> | ||
+ rename(.id=.L1) |> | ||
+ append_data("tmp.csv") -> dat | ||
> | ||
> data.table::fread(file.path(tempdir(),"tmp.csv")) -> dat1 | ||
> | ||
> stopifnot(all.equal(dat,dat1)) | ||
> | ||
> try(append_data("bob",file="tmp.csv")) | ||
Error : in 'append_data': Item 2 of input is not a data.frame, data.table or list | ||
> try(append_data("bob",file="tmp.csv",overwrite=TRUE)) | ||
Error : in 'append_data': is.list(x) is not TRUE | ||
> |