What should I do to create full package installation log ?
I assume that your talking about install.packages
.
See
?install.packages
The argument verbose
is mentioned. Did you try that one? Did it help?
Yes I am talking about install.packages
. I want to have a full console output saved into a text file ot whatever is possible.
This output sometimes is so huge that I can't scroll back to the beginning (to the command prompt in console up there) in order to copy it as a whole. How do I do it ? Is it some kind of limit in R console that limits a display's output ? I also have read about sink() function but I can't get it to work. For example:
install.packages("sf", type="source")
gives me an error about non-zero exit status and I want to save all that output, not a part of it because of print lines limit in the console.
You could try
capture.output(install.packages('package_name','other arguments'),
file = "install.log", append = FALSE,
type = c("output", "message"), split = FALSE)
with type
one of the two options output
or message
I hope that this gives you already enough information.
At one time I thought I needed both output
and message
so I extended the function above to HOQCutil::capture.output.both
to be able to specify both
:
HOQCutil::capture.output.both(install.packages('package_name','other arguments'),
file = "install.log", append = FALSE,
type = "both", split = FALSE)
You can install the package from GitHub with
devtools::install_github("HanOostdijk/HOQCutil")
or just copy the single function from
https://raw.githubusercontent.com/HanOostdijk/HOQCutil/master/R/cap.out.R
Thank you for your help, but it doesn't work. It gives only info that:
installation of package ‘...’ had non-zero exit status. I do not need a one-liner, I need full output.
Did you try the "both" version?
Please show the full call.
Here you are:
HOQCutil::capture.output.both(install.packages('sf',type="source", verbose=TRUE),
file = "install.log", append = FALSE,
type = "both", split = FALSE)
and
HOQCutil::capture.output.both(install.packages('sf',type="source"),
file = "install.log", append = FALSE,
type = "both", split = FALSE)
both do not work
That is a pity.
Then google for it.
With search words R install packages capture output
I found
https://stackoverflow.com/questions/9206932/capture-output-of-install-packages
An old one, but maybe it helps.
No more time today to have a look
So is it beyond R capabilities to provide full console output ? It is definitely beyond my possibilites now , but I hope someone can provide a hint or working solution.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.