Update an analysis

update_analysis(
  study,
  id,
  code = NULL,
  return = "",
  type = c("func", "text", "file"),
  new_id = NULL,
  ...
)

Arguments

study

A study list object with class scivrs_study

id

The id for this analysis (index or character) if an analysis with this id already exists, it will overwrite it

code

The code to run or a file name containing the code

return

A list of object names to return from the code

type

Whether the code is a function, text, or file name

new_id

A new (character) ID for this hypothesis

...

further arguments to add

Value

A study object with class scivrs_study

Examples

s <- study() %>% add_analysis("A1", rnorm(10))
s <- update_analysis(s, 1, code = rnorm(20), new_id = "A1a")
s
#> Demo Study
#> ----------
#> 
#> * Hypotheses: None
#> * Data: None
#> * Analyses: A1a
#>