Type: | Package |
Title: | Read and Write 'GraphPad Prism' Files |
Version: | 0.3.0 |
Description: | Read and write 'GraphPad Prism' '.pzfx' files in R. |
URL: | https://github.com/Yue-Jiang/pzfx |
BugReports: | https://github.com/Yue-Jiang/pzfx/issues |
Imports: | xml2 (≥ 1.2.0) |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.1 |
Suggests: | testthat, knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2020-07-04 03:41:33 UTC; yujiang |
Author: | Yue Jiang |
Maintainer: | Yue Jiang <rivehill@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2020-07-04 04:20:03 UTC |
List all tables in a 'GraphPad Prism' '.pzfx' file.
Description
List all tables in a 'GraphPad Prism' '.pzfx' file.
Usage
pzfx_tables(path)
Arguments
path |
Path to the '.pzfx' file |
Value
a character string vector
Examples
pzfx_file <- system.file("extdata/exponential_decay.pzfx", package = "pzfx", mustWork = TRUE)
pzfx_tables(pzfx_file)
Read one table from a 'GraphPad Prism' '.pzfx' file
Description
Read one table from a 'GraphPad Prism' '.pzfx' file
Usage
read_pzfx(path, table = 1, strike_action = "exclude", date_x = "character")
Arguments
path |
Path to the '.pzfx' file. |
table |
Table to read. Either a string (the name of a table), or an integer (the position of the table). If neither argument specifies the table, defaults to the first table. |
strike_action |
One of c("exclude", "keep", "star") or c("e", "k", "s"). Should stricken values in the original .pzfx be excluded, kept or labeled with a trailing "*". If a trailing "*" is added, the column will be of type character. |
date_x |
One of c("numeric", "character", "both") or c("n", "c", "b"). Should x column of format "Date" be handled as numeric (time elapsed from the first time point), character (the date string encoded by Prism, for example "8-Sep-2008"), or both (leading to two columns). |
Value
a data frame
Examples
pzfx_file <- system.file("extdata/exponential_decay.pzfx", package = "pzfx", mustWork = TRUE)
read_pzfx(pzfx_file, table = 1, strike_action="exclude", date_x="character")
Write one table or multiple tables to a 'GraphPad Prism' '.pzfx' file
Description
Write one table or multiple tables to a 'GraphPad Prism' '.pzfx' file. A table can be a 'matrix', a 'data.frame', or a 'tibble'. All elements of the table should be numeric.
Usage
write_pzfx(x, path, row_names = TRUE, x_col = NA)
Arguments
x |
Input table or named list of tables that will be 'Data Tables' in the '.pzfx' file |
path |
Path to the output '.pzfx' file. |
row_names |
Logical. If row names of the input table should be preserved and become row titles in the output '.pzfx' file. If the length is greater than 1, it must match the length of list of input tables. Default: TRUE. |
x_col |
1-based column index or name of the column to be used as the 'X' column. If the length is greater than 1, it must match the length of list of input tables. All other columns in the input tables will be treated as "Y" columns in the output '.pzfx' file. Default: NA |
Value
write_pzfx returns the input x invisibly.
Examples
pzfx_file <- system.file("extdata/exponential_decay.pzfx", package = "pzfx", mustWork = TRUE)
df <- read_pzfx(pzfx_file, table = 1, strike_action = "exclude")
write_pzfx(df, path = tempfile(fileext = ".pzfx"), row_names = TRUE)