mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 19:26:13 +01:00
Fix Latex PDF error
This commit is contained in:
parent
970e3ed7f1
commit
8fe70d5652
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 0.2.0
|
||||
Date: 2018-04-23
|
||||
Date: 2018-04-30
|
||||
Title: Antimicrobial Resistance Analysis
|
||||
Authors@R: c(
|
||||
person(
|
||||
|
@ -13,23 +13,15 @@
|
||||
#' @importFrom utils read.delim write.table object.size
|
||||
#' @details For \code{clipboard_export()}, the reserved clipboard size for exporting will be set to 125\% of the object size of \code{x}. This way, it is possible to export data with thousands of rows as the only limit will be your systems RAM.
|
||||
#'
|
||||
#' Example for copying from Excel:
|
||||
#' \if{html}{
|
||||
#' Example for copying from Excel:
|
||||
#' \out{<div style="text-align: left">}\figure{Excel_copy.png}\out{</div>}
|
||||
#' }
|
||||
#' \if{latex}{
|
||||
#' \out{\begin{left}}\figure{Excel_copy.png}\out{\end{left}}
|
||||
#' }
|
||||
#' \cr
|
||||
#' And pasting in R: \cr \cr
|
||||
#' \code{> data <- clipboard_import()} \cr
|
||||
#' \code{> data} \cr
|
||||
#' \if{html}{
|
||||
#' \out{<div style="text-align: left">}\figure{Excel_paste.png}\out{</div>}
|
||||
#' }
|
||||
#' \if{latex}{
|
||||
#' \out{\begin{left}}\figure{Excel_paste.png}\out{\end{left}}
|
||||
#' }
|
||||
#' @export
|
||||
#' @return data.frame
|
||||
clipboard_import <- function(sep = '\t',
|
||||
@ -135,14 +127,14 @@ clipboard_export <- function(x,
|
||||
}
|
||||
|
||||
is_Windows <- function() {
|
||||
Sys.info()['sysname'] %like% "Windows"
|
||||
all(Sys.info()['sysname'] %like% "Windows")
|
||||
}
|
||||
check_xclip <- function() {
|
||||
if (!isTRUE(file.exists(Sys.which("xclip")[1L]))) {
|
||||
if (Sys.info()['sysname'] %like% "Linux") {
|
||||
if (all(Sys.info()['sysname'] %like% "Linux")) {
|
||||
stop("Please install Linux package xclip first.")
|
||||
} else {
|
||||
stop("Please install package xclip first (use `brew install xclip on macOS`).")
|
||||
stop("Please install package xclip first (use `brew install xclip` on macOS).")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,23 +46,15 @@ These are helper functions around \code{\link{read.table}} and \code{\link{write
|
||||
\details{
|
||||
For \code{clipboard_export()}, the reserved clipboard size for exporting will be set to 125\% of the object size of \code{x}. This way, it is possible to export data with thousands of rows as the only limit will be your systems RAM.
|
||||
|
||||
Example for copying from Excel:
|
||||
\if{html}{
|
||||
Example for copying from Excel:
|
||||
\out{<div style="text-align: left">}\figure{Excel_copy.png}\out{</div>}
|
||||
}
|
||||
\if{latex}{
|
||||
\out{\begin{left}}\figure{Excel_copy.png}\out{\end{left}}
|
||||
}
|
||||
\cr
|
||||
And pasting in R: \cr \cr
|
||||
\code{> data <- clipboard_import()} \cr
|
||||
\code{> data} \cr
|
||||
\if{html}{
|
||||
\out{<div style="text-align: left">}\figure{Excel_paste.png}\out{</div>}
|
||||
}
|
||||
\if{latex}{
|
||||
\out{\begin{left}}\figure{Excel_paste.png}\out{\end{left}}
|
||||
}
|
||||
}
|
||||
\keyword{clipboard}
|
||||
\keyword{clipboard_export}
|
||||
|
@ -29,3 +29,16 @@ test_that("guess_bactid works", {
|
||||
"VISA")),
|
||||
rep("STAAUR", 8))
|
||||
})
|
||||
|
||||
test_that("guess_atc works", {
|
||||
expect_equal(guess_atc(c("J01FA01",
|
||||
"Erythromycin",
|
||||
"eryt",
|
||||
"ERYT",
|
||||
"ERY",
|
||||
"Erythrocin",
|
||||
"Eryzole",
|
||||
"Pediamycin")),
|
||||
rep("J01FA01", 8))
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user