View source: R/gather_messages.R
gather_messages | R Documentation |
Reads the Rout-file generated when running R in batch mode. Identifies lines with error and warning messages and report these. It is possible to predefine allowed warnings that shall not be reported.
gather_messages(
filename,
remove_allowed = c("was built under R version"),
remove_after = "Ferdig Batch"
)
filename |
[ |
remove_allowed |
[ |
remove_after |
[ |
remove_allowed
is used to remove warnings that is allowed.
Warnings that include the specified text string(s) will be removed. As
default warnings including the string "was built under R version" will be
removed. These warnings indicate that the package was built for a later
R-version than the version used to run the R-script.
remove_after
is used to remove all messages after a predefined
tag. The tag can be set using print() in the R-script producing the
Rout-file. This may be useful as error messages will be produced at the
end of Rout-file if the user don't have writing access at working
directory from which R-script is run.
Vector with error and warning messages that was written in the log.
Petter Hopp Petter.Hopp@vetinst.no
## Not run:
# Gather messages from the log file "script.Rout".
library(NVIbatch)
messages <- gather_messages(filename = file.path(getwd(), "script.Rout"),
remove_after = "Finished script")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.