Re: [R] building packages for Linux vs. Windows

2008-02-11 Thread Paul Gilbert
Erin Hodgess wrote:
 Hi R People:

 I sure that this is a really easy question, but here goes:

 I'm trying to build a package that will run on both Linux and Windows.

 However, there are several commands in a section that will be
 different in Linux than they are in Windows.
   
Erin

Several people have indicated how to do this, but I encourage you to be 
sure you really need to do it. Many things can be made to work the same 
way on all OSs, and packages are much easier to maintain if you do not 
have several variants.  You might consider posting a few example of 
where you find this necessary, and ask if there is an OS independent way 
to do it.

Paul Gilbert
 Would I be better off just to build two separate packages, please?
 If just one is needed, how could I determine which system is running
 in order to use the correct command, please?

 Thanks in advance,
 Erin


   


La version française suit le texte anglais.



This email may contain privileged and/or confidential in...{{dropped:26}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread Duncan Murdoch
On 10/02/2008 1:07 PM, Erin Hodgess wrote:
 Hi R People:
 
 I sure that this is a really easy question, but here goes:
 
 I'm trying to build a package that will run on both Linux and Windows.
 
 However, there are several commands in a section that will be
 different in Linux than they are in Windows.
 
 Would I be better off just to build two separate packages, please?
 If just one is needed, how could I determine which system is running
 in order to use the correct command, please?

You will find it much easier to build just one package.

You can use .Platform or (for more detail) Sys.info() to find out what 
kind of system you're running on.  Remember that R doesn't just run on 
Linux and Windows:  there's also MacOSX, and other Unix and Unix-like 
systems (Solaris, etc.).

Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] building packages for Linux vs. Windows

2008-02-10 Thread Erin Hodgess
Hi R People:

I sure that this is a really easy question, but here goes:

I'm trying to build a package that will run on both Linux and Windows.

However, there are several commands in a section that will be
different in Linux than they are in Windows.

Would I be better off just to build two separate packages, please?
If just one is needed, how could I determine which system is running
in order to use the correct command, please?

Thanks in advance,
Erin


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread John Sorkin
On my widows XP computer, W
From my windows XP system running R 2.6.1:
 version
   _   
platform   i386-pc-mingw32 
arch   i386
os mingw32 
system i386, mingw32   
status 
major  2   
minor  6.1 
year   2007
month  11  
day26  
svn rev43537   
language   R   
version.string R version 2.6.1 (2007-11-26)

John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

 Ted Harding [EMAIL PROTECTED] 2/10/2008 1:39 PM 
On 10-Feb-08 18:07:56, Erin Hodgess wrote:
 Hi R People:
 
 I sure that this is a really easy question, but here goes:
 
 I'm trying to build a package that will run on both Linux and Windows.
 
 However, there are several commands in a section that will be
 different in Linux than they are in Windows.
 
 Would I be better off just to build two separate packages, please?
 If just one is needed, how could I determine which system is running
 in order to use the correct command, please?
 
 Thanks in advance,
 Erin

There is the version (a list) variable:

  version
# platform   i486-pc-linux-gnu
# arch   i486
# os linux-gnu
# system i486, linux-gnu
# status Patched
# major  2
# minor  4.0
# year   2006
# month  11
# day25
# svn rev39997
# language   R

from which you can extract the os component:

  version$os
# [1] linux-gnu

I don;t know what this says on a Windows system,
but it surely won't mention Linux!

So testing this wil enable you to set a flag, e.g.

Linux-ifelse(length(grep(linux,version$os))0, TRUE, FALSE)

if(Linux){window-function(...) X11(...)} else
 {window-function(...) windows(...)}

Hoping this helps,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 10-Feb-08   Time: 18:39:29
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] building packages for Linux vs. Windows

2008-02-10 Thread Ted Harding
On 10-Feb-08 18:07:56, Erin Hodgess wrote:
 Hi R People:
 
 I sure that this is a really easy question, but here goes:
 
 I'm trying to build a package that will run on both Linux and Windows.
 
 However, there are several commands in a section that will be
 different in Linux than they are in Windows.
 
 Would I be better off just to build two separate packages, please?
 If just one is needed, how could I determine which system is running
 in order to use the correct command, please?
 
 Thanks in advance,
 Erin

There is the version (a list) variable:

  version
# platform   i486-pc-linux-gnu
# arch   i486
# os linux-gnu
# system i486, linux-gnu
# status Patched
# major  2
# minor  4.0
# year   2006
# month  11
# day25
# svn rev39997
# language   R

from which you can extract the os component:

  version$os
# [1] linux-gnu

I don;t know what this says on a Windows system,
but it surely won't mention Linux!

So testing this wil enable you to set a flag, e.g.

Linux-ifelse(length(grep(linux,version$os))0, TRUE, FALSE)

if(Linux){window-function(...) X11(...)} else
 {window-function(...) windows(...)}

Hoping this helps,
Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 10-Feb-08   Time: 18:39:29
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.