[R-pkg-devel] Writing a portable package that imports functions only available on Windows

Thierry Onkelinx thierry.onkelinx at inbo.be
Sat Sep 19 13:05:39 CEST 2015


Have a look at the RODBC package. odbcConnectAcces() is only available on
Windows.
Op 19-sep.-2015 12:08 schreef "Richard Cotton" <richierocks at gmail.com>:

> I have a package that uses win.version from the utils package.
>
> I've made my R code safe to use across platforms, I check that the OS is
> Windows before calling win.version.
>
> The NAMESPACE file contains the line
>
> importFrom(utils,win.version)
>
> which causes an install failure under other OSes since that function
> doesn't exist.
>
> Can I use this platform-dependent function and still have a cross-platform
> package?
>
> Also, it seems like it would be nicer if the utils package always included
> this function and returned NA with a warning on platforms other than
> Windows.  Does that sound like a reasonable change?
>
> --
> Regards,
> Richie
>
> Learning R <http://shop.oreilly.com/product/0636920028352.do>
> 4dpiecharts.com
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list