[R] R for Windows: Is there a function/package that enables Win32 API Calls?

2012-01-16 Thread Ajay Askoolum
I am looking for a means to call Win32 API calls from R for Windows. Is that 
possible?

Thanks.

[[alternative HTML version deleted]]

__
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] R for Windows: Is there a function/package that enables Win32 API Calls?

2012-01-16 Thread Tal Galili
Wouldn't that be possbile to do through the
?system
function?


Contact
Details:---
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--




On Mon, Jan 16, 2012 at 9:45 PM, Ajay Askoolum aa2e...@yahoo.co.uk wrote:

 I am looking for a means to call Win32 API calls from R for Windows. Is
 that possible?

 Thanks.

[[alternative HTML version deleted]]

 __
 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.


[[alternative HTML version deleted]]

__
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] R for Windows: Is there a function/package that enables Win32 API Calls?

2012-01-16 Thread Ajay Askoolum
As far as I can see, R's system, shell etc. functions either call/launch 
functionality in the core operating system (COMMAND.COM) or free standing exes.

Win32 APIs are buried inside operating system synamic link libraries (DLLs) and 
can be called by other languages. An example is:


Function PathFileExists Lib shlwapi.dll 
Alias PathFileExistsA (ByVal pszPath As String) As Long

Here, the API is PathFileExists, which is found in SHWAPI.DLL; it requires a 
characer argument that is either the name of a file or directory and returns 
TRUE if it exists or FALSE if it doesn't. 

A number of these APIs are available in R builtin functions but there are 
others that aren't. I asked the question because if there is a way in R to call 
these APIs. a great deal of time can be saved.
[[alternative HTML version deleted]]

__
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] R for Windows: Is there a function/package that enables Win32 API Calls?

2012-01-16 Thread Duncan Murdoch

On 12-01-16 2:45 PM, Ajay Askoolum wrote:

I am looking for a means to call Win32 API calls from R for Windows. Is that 
possible?


Just write the call in C, and call your C code from R, using .C() or 
.Call() (depending on what you need to pass to it).  Generally .C() is 
easier, but .Call() is faster and more flexible.


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.