import_from_html {preregr}R Documentation

Import a (pre)registration specification from JSON embedded in HTML

Description

Import a (pre)registration specification from JSON embedded in HTML

Usage

import_from_html(x, select = 1)

Arguments

x

The HTML as URL, path to a file, or HTML that has already been imported to a character vector.

select

If multiple preregr specifications are present in x, the select argument can be used to select which one to import. select is a number corresponding to the order of the encountered preregr specifications (e.g., pass 2 to import the second specification, etc).

Value

The (pre)registration specification.

Examples


### Note that this example writes to a local file!

### Temporary file to save to
tmpFile <- tempfile(fileext = ".html");

### Load an example (pre)registration specification
data("examplePrereg_1", package = "preregr");

### Save it to an HTML file
preregr::prereg_spec_to_html(
  examplePrereg_1,
  file = tmpFile
);

### Import the example again
importedPreregr <-
  preregr::import_from_html(
    tmpFile
  );

### Show the result
preregr::prereg_show_item_completion(
  importedPreregr,
  section="metadata"
);


[Package preregr version 0.2.9 Index]