Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread Ben Bolker

  I have at various times tried the built-in (tools package) solution;
fairly complex hand-rolled stuff I did myself; and revdepcheck.  I found
that revdepcheck handled installation of needed dependencies, including
caching packages where necessary, more easily.  It felt like the 'tools'
machinery worked better if I already had all or most of the CRAN
packages installed ... (My experimentation has been done
non-systematically and over a long period of time, so I may well have
mistaken/missed something.)

On 2018-04-11 06:03 PM, Uwe Ligges wrote:
> Not sure why nobody dicusses the R internal check functionality, also
> for reverse dependencies, from the tools package?
> That is what CRAN uses for the reverse dependency checks.
> 
> Best,
> Uwe Ligges
> 
> 
> 
> 
> On 11.04.2018 23:14, J C Nash wrote:
>> Another workaround is to use
>>
>> tlogl <- readLines(attr(cpkg.chk, "path"))
>>
>> Possibly this may suggest a way to improve functionality.
>>
>> JN
>>
>> On 2018-04-11 03:24 PM, Henrik Bengtsson wrote:
>>> R CMD check, which is used internally runs checks in standalone
>>> background R processes.  Output from these is not capturable/sinkable
>>> by the master R process.  The gist of what's happening is:
>>>
 sink("output.log")
 system("echo hello")  ## not sinked/captured
>>> hello
 sink()
 readLines("output.log")
>>> character(0)
>>>
>>> /Henrik
>>>
>>> On Wed, Apr 11, 2018 at 11:05 AM, J C Nash  wrote:
 Hi,

 In trying to test that an upgrade to my optimx package does not
 break other
 packages, I wanted to loop over a list of all such packages in
 alldep, with
 nall the length of this list.

 cat("Check the dependent packages\n")
 for (ii in 1:nall){
    cpkg <- alldep[ii]
    dd <- "/home/john/temp/wrkopt/dlpkg"
    dlname <- download.packages(cpkg, destdir=dd )[[2]]
    cat("Downloaded ", dlname,"\n")
    cpkg.chk <- devtools::check_built(dlname)
    cat("Results package:",cpkg,"\n")
    print(cpkg.chk)
 }

 Before running this, I did

 sink("dpkgcheck.txt", split=TRUE)

 and afterwards, I did sink().

 But ... none of the check output, nor the result of the final print,
 show
 up in the output file dpkgcheck.txt.

 Have I totally misunderstood sink(), or is there a nasty bug?

 I've tried running in Rstudio and in the terminal. I'm running Linux
 Mint
 18.3 Sylvia.

 Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10
 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
 john@john-j6-18 ~ $ R

 R version 3.4.4 (2018-03-15) -- "Someone to Lean On"


 J C Nash

 __
 R-package-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread Uwe Ligges
Not sure why nobody dicusses the R internal check functionality, also 
for reverse dependencies, from the tools package?

That is what CRAN uses for the reverse dependency checks.

Best,
Uwe Ligges




On 11.04.2018 23:14, J C Nash wrote:

Another workaround is to use

tlogl <- readLines(attr(cpkg.chk, "path"))

Possibly this may suggest a way to improve functionality.

JN

On 2018-04-11 03:24 PM, Henrik Bengtsson wrote:

R CMD check, which is used internally runs checks in standalone
background R processes.  Output from these is not capturable/sinkable
by the master R process.  The gist of what's happening is:


sink("output.log")
system("echo hello")  ## not sinked/captured

hello

sink()
readLines("output.log")

character(0)

/Henrik

On Wed, Apr 11, 2018 at 11:05 AM, J C Nash  wrote:

Hi,

In trying to test that an upgrade to my optimx package does not break other
packages, I wanted to loop over a list of all such packages in alldep, with
nall the length of this list.

cat("Check the dependent packages\n")
for (ii in 1:nall){
   cpkg <- alldep[ii]
   dd <- "/home/john/temp/wrkopt/dlpkg"
   dlname <- download.packages(cpkg, destdir=dd )[[2]]
   cat("Downloaded ", dlname,"\n")
   cpkg.chk <- devtools::check_built(dlname)
   cat("Results package:",cpkg,"\n")
   print(cpkg.chk)
}

Before running this, I did

sink("dpkgcheck.txt", split=TRUE)

and afterwards, I did sink().

But ... none of the check output, nor the result of the final print, show
up in the output file dpkgcheck.txt.

Have I totally misunderstood sink(), or is there a nasty bug?

I've tried running in Rstudio and in the terminal. I'm running Linux Mint
18.3 Sylvia.

Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
john@john-j6-18 ~ $ R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"


J C Nash

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread J C Nash
Indeed these are useful for one of my present tasks. Thanks. JN

On 2018-04-11 03:10 PM, Georgi Boshnakov wrote:
> 
> Hi, 
> 
> Not really an answer but I only recently discovered  devtools::revdep(), 
> which automates checking reverse dependencies. 
> 
> Georgi Boshnakov
> 
> 
> 
> 
> 
> From: R-package-devel [r-package-devel-boun...@r-project.org] on behalf of J 
> C Nash [profjcn...@gmail.com]
> Sent: 11 April 2018 19:05
> To: List r-package-devel
> Subject: [R-pkg-devel] Saving output of check()
> 
> Hi,
> 
> In trying to test that an upgrade to my optimx package does not break other
> packages, I wanted to loop over a list of all such packages in alldep, with
> nall the length of this list.
> 
> cat("Check the dependent packages\n")
> for (ii in 1:nall){
>   cpkg <- alldep[ii]
>   dd <- "/home/john/temp/wrkopt/dlpkg"
>   dlname <- download.packages(cpkg, destdir=dd )[[2]]
>   cat("Downloaded ", dlname,"\n")
>   cpkg.chk <- devtools::check_built(dlname)
>   cat("Results package:",cpkg,"\n")
>   print(cpkg.chk)
> }
> 
> Before running this, I did
> 
> sink("dpkgcheck.txt", split=TRUE)
> 
> and afterwards, I did sink().
> 
> But ... none of the check output, nor the result of the final print, show
> up in the output file dpkgcheck.txt.
> 
> Have I totally misunderstood sink(), or is there a nasty bug?
> 
> I've tried running in Rstudio and in the terminal. I'm running Linux Mint
> 18.3 Sylvia.
> 
> Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 
> UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> john@john-j6-18 ~ $ R
> 
> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
> 
> 
> J C Nash
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread J C Nash
Another workaround is to use

tlogl <- readLines(attr(cpkg.chk, "path"))

Possibly this may suggest a way to improve functionality.

JN

On 2018-04-11 03:24 PM, Henrik Bengtsson wrote:
> R CMD check, which is used internally runs checks in standalone
> background R processes.  Output from these is not capturable/sinkable
> by the master R process.  The gist of what's happening is:
> 
>> sink("output.log")
>> system("echo hello")  ## not sinked/captured
> hello
>> sink()
>> readLines("output.log")
> character(0)
> 
> /Henrik
> 
> On Wed, Apr 11, 2018 at 11:05 AM, J C Nash  wrote:
>> Hi,
>>
>> In trying to test that an upgrade to my optimx package does not break other
>> packages, I wanted to loop over a list of all such packages in alldep, with
>> nall the length of this list.
>>
>> cat("Check the dependent packages\n")
>> for (ii in 1:nall){
>>   cpkg <- alldep[ii]
>>   dd <- "/home/john/temp/wrkopt/dlpkg"
>>   dlname <- download.packages(cpkg, destdir=dd )[[2]]
>>   cat("Downloaded ", dlname,"\n")
>>   cpkg.chk <- devtools::check_built(dlname)
>>   cat("Results package:",cpkg,"\n")
>>   print(cpkg.chk)
>> }
>>
>> Before running this, I did
>>
>> sink("dpkgcheck.txt", split=TRUE)
>>
>> and afterwards, I did sink().
>>
>> But ... none of the check output, nor the result of the final print, show
>> up in the output file dpkgcheck.txt.
>>
>> Have I totally misunderstood sink(), or is there a nasty bug?
>>
>> I've tried running in Rstudio and in the terminal. I'm running Linux Mint
>> 18.3 Sylvia.
>>
>> Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 
>> 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
>> john@john-j6-18 ~ $ R
>>
>> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
>>
>>
>> J C Nash
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread J C Nash
I got several responses to my query. Henrik's does suggest "why", but I
am rather unhappy that R has this weakness. (See below for a sort of
workaround for Linux users.)

In particular, note that the check_built() function DOES return an object,
but it does NOT print().

In fact, putting alldep <- "embryogrowth" gives a result file

> Check the dependent packages
> Downloaded  /home/john/temp/wrkopt/dlpkg/embryogrowth_7.4.tar.gz 
> Results package: embryogrowth 
> 

while the bottom of the terminal file gives

> * checking data for non-ASCII characters ... OK
> * checking data for ASCII and uncompressed saves ... OK
> * checking examples ... OK
> * DONE
> 
> Status: OK
> 
> Results package: embryogrowth 
> R CMD check results
> 0 errors | 0 warnings | 0 notes
> 
>> 
>> sink()
>> 

Now the object cpkg.chk is still present, so I continued the exercise (terminal
copy here)

> 
>> ls()
> [1] "alldep"   "cpkg" "cpkg.chk" "dd"   "dlname"   "ii"   "nall"  
>   
>> sink("sinktest2.txt", split=TRUE)
>> cpkg.chk
> R CMD check results
> 0 errors | 0 warnings | 0 notes
> 
>> print(cpkg.chk)
> R CMD check results
> 0 errors | 0 warnings | 0 notes
> 
>> cat("note the above use just the object name as well as print()\n")
> note the above use just the object name as well as print()
>> sink()
>> 

but the file sinktest2.txt is just

> 
> note the above use just the object name as well as print()

Perhaps this isn't a bug, but it rather smells like one, especially the
failure to show the cpkg.chk.

Workaround for Linux: Run things via

R |& tee -a myteeoutput.txt

This will keep all the output (sink not needed). But it isn't quite as nice
for keeping the data.

I've also not managed to find a way to get the information out of the cpkg.chk
object. If someone knows how to do that, it would help.

Best, JN








On 2018-04-11 03:24 PM, Henrik Bengtsson wrote:
> R CMD check, which is used internally runs checks in standalone
> background R processes.  Output from these is not capturable/sinkable
> by the master R process.  The gist of what's happening is:
> 
>> sink("output.log")
>> system("echo hello")  ## not sinked/captured
> hello
>> sink()
>> readLines("output.log")
> character(0)
> 
> /Henrik
> 
> On Wed, Apr 11, 2018 at 11:05 AM, J C Nash  wrote:
>> Hi,
>>
>> In trying to test that an upgrade to my optimx package does not break other
>> packages, I wanted to loop over a list of all such packages in alldep, with
>> nall the length of this list.
>>
>> cat("Check the dependent packages\n")
>> for (ii in 1:nall){
>>   cpkg <- alldep[ii]
>>   dd <- "/home/john/temp/wrkopt/dlpkg"
>>   dlname <- download.packages(cpkg, destdir=dd )[[2]]
>>   cat("Downloaded ", dlname,"\n")
>>   cpkg.chk <- devtools::check_built(dlname)
>>   cat("Results package:",cpkg,"\n")
>>   print(cpkg.chk)
>> }
>>
>> Before running this, I did
>>
>> sink("dpkgcheck.txt", split=TRUE)
>>
>> and afterwards, I did sink().
>>
>> But ... none of the check output, nor the result of the final print, show
>> up in the output file dpkgcheck.txt.
>>
>> Have I totally misunderstood sink(), or is there a nasty bug?
>>
>> I've tried running in Rstudio and in the terminal. I'm running Linux Mint
>> 18.3 Sylvia.
>>
>> Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 
>> 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
>> john@john-j6-18 ~ $ R
>>
>> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
>>
>>
>> J C Nash
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread Henrik Bengtsson
R CMD check, which is used internally runs checks in standalone
background R processes.  Output from these is not capturable/sinkable
by the master R process.  The gist of what's happening is:

> sink("output.log")
> system("echo hello")  ## not sinked/captured
hello
> sink()
> readLines("output.log")
character(0)

/Henrik

On Wed, Apr 11, 2018 at 11:05 AM, J C Nash  wrote:
> Hi,
>
> In trying to test that an upgrade to my optimx package does not break other
> packages, I wanted to loop over a list of all such packages in alldep, with
> nall the length of this list.
>
> cat("Check the dependent packages\n")
> for (ii in 1:nall){
>   cpkg <- alldep[ii]
>   dd <- "/home/john/temp/wrkopt/dlpkg"
>   dlname <- download.packages(cpkg, destdir=dd )[[2]]
>   cat("Downloaded ", dlname,"\n")
>   cpkg.chk <- devtools::check_built(dlname)
>   cat("Results package:",cpkg,"\n")
>   print(cpkg.chk)
> }
>
> Before running this, I did
>
> sink("dpkgcheck.txt", split=TRUE)
>
> and afterwards, I did sink().
>
> But ... none of the check output, nor the result of the final print, show
> up in the output file dpkgcheck.txt.
>
> Have I totally misunderstood sink(), or is there a nasty bug?
>
> I've tried running in Rstudio and in the terminal. I'm running Linux Mint
> 18.3 Sylvia.
>
> Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 
> UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
> john@john-j6-18 ~ $ R
>
> R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
>
>
> J C Nash
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Saving output of check()

2018-04-11 Thread Georgi Boshnakov

Hi, 

Not really an answer but I only recently discovered  devtools::revdep(), which 
automates checking reverse dependencies. 

Georgi Boshnakov





From: R-package-devel [r-package-devel-boun...@r-project.org] on behalf of J C 
Nash [profjcn...@gmail.com]
Sent: 11 April 2018 19:05
To: List r-package-devel
Subject: [R-pkg-devel] Saving output of check()

Hi,

In trying to test that an upgrade to my optimx package does not break other
packages, I wanted to loop over a list of all such packages in alldep, with
nall the length of this list.

cat("Check the dependent packages\n")
for (ii in 1:nall){
  cpkg <- alldep[ii]
  dd <- "/home/john/temp/wrkopt/dlpkg"
  dlname <- download.packages(cpkg, destdir=dd )[[2]]
  cat("Downloaded ", dlname,"\n")
  cpkg.chk <- devtools::check_built(dlname)
  cat("Results package:",cpkg,"\n")
  print(cpkg.chk)
}

Before running this, I did

sink("dpkgcheck.txt", split=TRUE)

and afterwards, I did sink().

But ... none of the check output, nor the result of the final print, show
up in the output file dpkgcheck.txt.

Have I totally misunderstood sink(), or is there a nasty bug?

I've tried running in Rstudio and in the terminal. I'm running Linux Mint
18.3 Sylvia.

Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
john@john-j6-18 ~ $ R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"


J C Nash

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Saving output of check()

2018-04-11 Thread J C Nash
Hi,

In trying to test that an upgrade to my optimx package does not break other
packages, I wanted to loop over a list of all such packages in alldep, with
nall the length of this list.

cat("Check the dependent packages\n")
for (ii in 1:nall){
  cpkg <- alldep[ii]
  dd <- "/home/john/temp/wrkopt/dlpkg"
  dlname <- download.packages(cpkg, destdir=dd )[[2]]
  cat("Downloaded ", dlname,"\n")
  cpkg.chk <- devtools::check_built(dlname)
  cat("Results package:",cpkg,"\n")
  print(cpkg.chk)
}

Before running this, I did

sink("dpkgcheck.txt", split=TRUE)

and afterwards, I did sink().

But ... none of the check output, nor the result of the final print, show
up in the output file dpkgcheck.txt.

Have I totally misunderstood sink(), or is there a nasty bug?

I've tried running in Rstudio and in the terminal. I'm running Linux Mint
18.3 Sylvia.

Linux john-j6-18 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
john@john-j6-18 ~ $ R

R version 3.4.4 (2018-03-15) -- "Someone to Lean On"


J C Nash

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel