Re: [R-pkg-devel] [r-package-devel] Win.Metafile and package check - "Found the platform-specific device:"

2023-11-04 Thread Wayne.W.Jones
Update:

I noticed in the ggplot2 codebase they also have a call to win.metafile - see 
https://github.com/tidyverse/ggplot2/blob/main/R/save.R#L280-L281

When I use grDevices::win.metafile instead of win.metafile it passes the local 
checks fine.

Wayne

-Original Message-
From: Jones, Wayne R GSUK-PTX/D/S
Sent: 04 November 2023 09:03
To: Vladimir Dergachev 
Cc: r-package-devel@r-project.org
Subject: RE: [R-pkg-devel] [r-package-devel] Win.Metafile and package check - 
"Found the platform-specific device:"

Hi Vladimir,

Thanks for the suggestions. I've considered both but I can't see a way of doing 
what I'm trying to achieve without explicitly adding a call to win.metafile in 
my code.

To explain a little more...

GWSDAT is a Shiny App so we don't use the traditional R graphics device - so 
your suggestion #1 is not an option . Instead, the user is offered a range of 
different plot options in a shiny list box as illustrated here in this windows 
based example:
https://user-images.githubusercontent.com/61183826/280452267-c4287f8d-73cc-42a3-881a-4643bdb31689.png

The list of options presented to the users in the list box is modified 
according to the platform - see code here:  
https://github.com/WayneGitShell/GWSDAT/blob/master/R/server.R#L117-L118

So anyone using a non-windows platform will never be offered the choice of 
"wmf"  to begin with. For example, see the online LINUX  version, 
https://stats-glasgow.shinyapps.io/GWSDATV3-2/.  You will see that this option 
doesn't exist in the list of choices - see 
https://user-images.githubusercontent.com/61183826/280453275-6da9b235-0387-47fd-b3a8-b0a949f0ec3e.png

Any suggestions on how I can modify this approach to make it automatically pass 
the CRAN checks?

Thanks,

Wayne

-Original Message-
From: Vladimir Dergachev 
Sent: 03 November 2023 20:03
To: Jones, Wayne R GSUK-PTX/D/S 
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [r-package-devel] Win.Metafile and package check - 
"Found the platform-specific device:"

Think Secure. This email is from an external source.

On Fri, 3 Nov 2023, wayne.w.jo...@shell.com wrote:

> Dear R-Package-Devel,
>
> As part of GWSDAT package (https://github.com/waynegitshell/GWSDAT) we 
> support the option to output plots to a WMF 
> (https://r-graphics.org/recipe-output-vector-wmf) format if, and only if,  
> the user is on Windows. However, when I run the package checks on here it 
> complains about using a platform specific function with the following message:
>
>  Found the platform-specific device:
>'win.metafile'
>  dev.new() is the preferred way to open a new device, in the unlikely
> event one is needed.
>
> In my opinion this is a false positive - and a similar issue has
> previously been reported here:
> https://stac/
> koverflow.com%2Fquestions%2F70585796%2Funable-to-understand-1-note-in-
> devtoolscheck-caused-by-a-platform-specific-d=05%7C01%7CWayne.W.J
> ones%40shell.com%7C991ba83bef5648af7e8408dbdca7deea%7Cdb1e96a8a3da442a
> 930b235cac24cd5c%7C0%7C0%7C638346385789331058%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3
> 000%7C%7C%7C=FLTuWH3yJq0sK%2FePWzv5ga%2FcXQGvHNmQOauw3x5RTXc%3D&
> reserved=0
>
> Any ideas on how I modify the code and package submission to automatically 
> pass the checks?

Two suggestions:

   * let users specify the graphics device they want

   * reading manpage for dev.new() it accepts a bunch of options - there is 
probably a way to request the metafile device you want. But I could not find 
that in documentation.

best

Vladimir Dergachev

>
> Thanks,
>
> Wayne
>
>
>
> --
> --
> Wayne Jones
> Principal Data Scientist
> Decarbonisation Data Science
>
> Tel: +44 (0) 207 934 4330
> Projects and Technology, Shell Research Limited, Shell Centre, York
> Road, London, SE1 7NA
> Email: wayne.w.jo...@shell.com
> Intranet:
> Shell.ai 2F%2Feu001-sp.shell.com%2Fsites%2FAAFAA6690%2FShell.ai%2Fhomepage.aspx
> =05%7C01%7CWayne.W.Jones%40shell.com%7C991ba83bef5648af7e8408dbdc
> a7deea%7Cdb1e96a8a3da442a930b235cac24cd5c%7C0%7C0%7C638346385789331058
> %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I
> k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=z9EBpBRKRttm2r5hJkEol54xSA
> 6hp76CTjZVvahYoso%3D=0>
> Internet:
> http://www.s/
> hell.ai%2F=05%7C01%7CWayne.W.Jones%40shell.com%7C991ba83bef5648af
> 7e8408dbdca7deea%7Cdb1e96a8a3da442a930b235cac24cd5c%7C0%7C0%7C63834638
> 5789331058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=zaHgal1ZfA5%2B0l
> FhpJoq2FEEJb1d5kQrogu9%2FLQt3Po%3D=0 protection.outlook.com/?url=http%3A%2F%2Fwww.shell.ai%2F=05%7C01%
> 7CWayne.W.Jones%40shell.com%7C991ba83bef5648af7e8408dbdca7deea%7Cdb1e9
> 

Re: [R-pkg-devel] [r-package-devel] Win.Metafile and package check - "Found the platform-specific device:"

2023-11-04 Thread Wayne.W.Jones
Hi Vladimir,

Thanks for the suggestions. I've considered both but I can't see a way of doing 
what I'm trying to achieve without explicitly adding a call to win.metafile in 
my code.

To explain a little more...

GWSDAT is a Shiny App so we don't use the traditional R graphics device - so 
your suggestion #1 is not an option . Instead, the user is offered a range of 
different plot options in a shiny list box as illustrated here in this windows 
based example:
https://user-images.githubusercontent.com/61183826/280452267-c4287f8d-73cc-42a3-881a-4643bdb31689.png

The list of options presented to the users in the list box is modified 
according to the platform - see code here:  
https://github.com/WayneGitShell/GWSDAT/blob/master/R/server.R#L117-L118

So anyone using a non-windows platform will never be offered the choice of 
"wmf"  to begin with. For example, see the online LINUX  version, 
https://stats-glasgow.shinyapps.io/GWSDATV3-2/.  You will see that this option 
doesn't exist in the list of choices - see 
https://user-images.githubusercontent.com/61183826/280453275-6da9b235-0387-47fd-b3a8-b0a949f0ec3e.png

Any suggestions on how I can modify this approach to make it automatically pass 
the CRAN checks?

Thanks,

Wayne

-Original Message-
From: Vladimir Dergachev 
Sent: 03 November 2023 20:03
To: Jones, Wayne R GSUK-PTX/D/S 
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] [r-package-devel] Win.Metafile and package check - 
"Found the platform-specific device:"

Think Secure. This email is from an external source.

On Fri, 3 Nov 2023, wayne.w.jo...@shell.com wrote:

> Dear R-Package-Devel,
>
> As part of GWSDAT package (https://github.com/waynegitshell/GWSDAT) we 
> support the option to output plots to a WMF 
> (https://r-graphics.org/recipe-output-vector-wmf) format if, and only if,  
> the user is on Windows. However, when I run the package checks on here it 
> complains about using a platform specific function with the following message:
>
>  Found the platform-specific device:
>'win.metafile'
>  dev.new() is the preferred way to open a new device, in the unlikely
> event one is needed.
>
> In my opinion this is a false positive - and a similar issue has
> previously been reported here:
> https://stac/
> koverflow.com%2Fquestions%2F70585796%2Funable-to-understand-1-note-in-
> devtoolscheck-caused-by-a-platform-specific-d=05%7C01%7CWayne.W.J
> ones%40shell.com%7C991ba83bef5648af7e8408dbdca7deea%7Cdb1e96a8a3da442a
> 930b235cac24cd5c%7C0%7C0%7C638346385789331058%7CUnknown%7CTWFpbGZsb3d8
> eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3
> 000%7C%7C%7C=FLTuWH3yJq0sK%2FePWzv5ga%2FcXQGvHNmQOauw3x5RTXc%3D&
> reserved=0
>
> Any ideas on how I modify the code and package submission to automatically 
> pass the checks?

Two suggestions:

   * let users specify the graphics device they want

   * reading manpage for dev.new() it accepts a bunch of options - there is 
probably a way to request the metafile device you want. But I could not find 
that in documentation.

best

Vladimir Dergachev

>
> Thanks,
>
> Wayne
>
>
>
> --
> --
> Wayne Jones
> Principal Data Scientist
> Decarbonisation Data Science
>
> Tel: +44 (0) 207 934 4330
> Projects and Technology, Shell Research Limited, Shell Centre, York
> Road, London, SE1 7NA
> Email: wayne.w.jo...@shell.com
> Intranet:
> Shell.ai 2F%2Feu001-sp.shell.com%2Fsites%2FAAFAA6690%2FShell.ai%2Fhomepage.aspx
> =05%7C01%7CWayne.W.Jones%40shell.com%7C991ba83bef5648af7e8408dbdc
> a7deea%7Cdb1e96a8a3da442a930b235cac24cd5c%7C0%7C0%7C638346385789331058
> %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I
> k1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=z9EBpBRKRttm2r5hJkEol54xSA
> 6hp76CTjZVvahYoso%3D=0>
> Internet:
> http://www.s/
> hell.ai%2F=05%7C01%7CWayne.W.Jones%40shell.com%7C991ba83bef5648af
> 7e8408dbdca7deea%7Cdb1e96a8a3da442a930b235cac24cd5c%7C0%7C0%7C63834638
> 5789331058%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=zaHgal1ZfA5%2B0l
> FhpJoq2FEEJb1d5kQrogu9%2FLQt3Po%3D=0 protection.outlook.com/?url=http%3A%2F%2Fwww.shell.ai%2F=05%7C01%
> 7CWayne.W.Jones%40shell.com%7C991ba83bef5648af7e8408dbdca7deea%7Cdb1e9
> 6a8a3da442a930b235cac24cd5c%7C0%7C0%7C638346385789331058%7CUnknown%7CT
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI
> 6Mn0%3D%7C3000%7C%7C%7C=zaHgal1ZfA5%2B0lFhpJoq2FEEJb1d5kQrogu9%2
> FLQt3Po%3D=0>
>
>
>   [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat/
> 

[R-pkg-devel] [r-package-devel] Win.Metafile and package check - "Found the platform-specific device:"

2023-11-03 Thread Wayne.W.Jones
Dear R-Package-Devel,

As part of GWSDAT package (https://github.com/waynegitshell/GWSDAT) we support 
the option to output plots to a WMF 
(https://r-graphics.org/recipe-output-vector-wmf) format if, and only if,  the 
user is on Windows. However, when I run the package checks on here it complains 
about using a platform specific function with the following message:

  Found the platform-specific device:
'win.metafile'
  dev.new() is the preferred way to open a new device, in the unlikely
  event one is needed.

In my opinion this is a false positive - and a similar issue has previously 
been reported here: 
https://stackoverflow.com/questions/70585796/unable-to-understand-1-note-in-devtoolscheck-caused-by-a-platform-specific-d

Any ideas on how I modify the code and package submission to automatically pass 
the checks?

Thanks,

Wayne




Wayne Jones
Principal Data Scientist
Decarbonisation Data Science

Tel: +44 (0) 207 934 4330
Projects and Technology, Shell Research Limited, Shell Centre, York Road, 
London, SE1 7NA
Email: wayne.w.jo...@shell.com
Intranet: 
Shell.ai
Internet: www.shell.ai


[[alternative HTML version deleted]]

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


[Rd] Windows R-3.0.0 and Tcl/tkrplot issue

2013-03-19 Thread Wayne.W.Jones
Greetings R Developers,

I've been testing the alpha release of R-3.0.0 and I noticed that the plotting 
functionality in package tkrplot was not working correctly.
Further diagnosis found the issue to be related to the command '.Tcl(image 
create Rplot plotname)' from package tkrplot.

The following example is  taken from here:  
http://tkrplot.sourcearchive.com/documentation/0.0.14/tcltkimg_8c_source.html

 library(tkrplot)
 library(tcltk)
 my.tkdev - function() win.metafile(width=4,height=4)
 my.tkdev()
 plot(1:20)
 .Tcl(image create Rplot fred)
Error in structure(.External(.C_dotTcl, ...), class = tclObj) :
  [tcl] can't get device image.

This example works fine in R-2.15.3.  I've emailed the package maintainer Luke 
Tierney but unfortunately he doesn't have the ability to build and test 
packages on windows.
Can anyone elucidate what tcltk changes have been made in moving to R-3.0.0?

Details of installation are as follows:

 version
platform   i386-w64-mingw32
arch   i386
os mingw32
system i386, mingw32
status alpha
major  3
minor  0.0
year   2013
month  03
day16
svn rev62282
language   R
version.string R version 3.0.0 alpha (2013-03-16 r62282)
nickname   Unsuffered Consequences


Thanks,

Wayne


Wayne Jones
Statistics  Chemometrics
Shell Global Solutions (UK)
Shell Technology Centre Thornton
P.O. Box 1, Chester CH1 3SH, United Kingdom
Tel: +44 (0) 151 373 5977 Mobile: +44 (0) 7896 536026
Email: wayne.w.jo...@shell.commailto:wayne.w.jo...@shell.com
Intranet: Statistics and Chemometrics - Shell 
Wikihttp://sww.wiki.shell.com/wiki/index.php/Statistics_and_Chemometrics
Internet: Shell Global 
Solutionshttp://www.shell.com/home/content/globalsolutions

Shell Global Solutions (UK) is a division of Shell Research Limited which has 
its Registered Office at Shell Centre, London SE1 7NA and is registered in 
England  Wales with No.539964.


[[alternative HTML version deleted]]

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