Displaying 9 results from an estimated 9 matches for "open2".
Did you mean:
open
2010 Sep 10
2
[xts, quantmod] segfault probelm when I work with memcpy function
...nd based on for loop:
#include <R.h>
#include <Rinternals.h>
SEXP open(SEXP x) {
int nr=nrows(x);
SEXP r;
PROTECT(r=allocVector(REALSXP,nr));
memcpy(&REAL(r)[0],&REAL(x)[0],nr*sizeof(double));
UNPROTECT(1);
return(r);
}
SEXP open2(SEXP x) {
int P=0;
if (TYPEOF(x) != REALSXP) { PROTECT(x = coerceVector(x,REALSXP)); P++; }
double *d_x = REAL(x);
int nr = nrows(x);
SEXP s;
PROTECT(s = allocVector(REALSXP,nr));
P++;
double *d_s = REAL(s);
int i;
fo...
2001 Dec 27
3
read input from STDIN
Hello,
I have a perl program which produces the input. Instead of print it to a
file then let R read the file,
I want to let R to read the input directly from the perl output,
I am using a PERL IPC::open2 module for this,
local (*Read,*Writer);
$pid = open2(\*Read, \*Writer, "R --no-save --slave< my.R")
#input to R
for(){
print Writer data;
}
close Writer;
#R output
@result = <Read>;
How can "my.R" read the stdin and figure out the relationship in the data?
I tr...
2010 Aug 06
1
apply family functions
Hi all,
I would like to flag each record in the data according to certain conditions
as specified below.
For example,
If "Close_date" in *dat* is between ("Open" & "Close") or ("Open1" &
"Close1") or ("Open2" & "Close2") in *oc, *flag the records as "Valid",
otherwise "Invalid"
I would like to use sapply family functions if possible due to the nature of
large data set.
ini <- as.Date("2010/1/1", "%Y/%m/%d")
# Generate arbitrary data frame...
1999 Dec 06
2
perl advice
Hello-
Does anyone have a recommendation on how to call R from perl? I'm using
the IPC::Open2 module, and running R with the --slave and --quiet
options. The problem is that I can't predict how many lines of output I
should try to read for each command-- if any!
The ultimate goal is to use perl to provide a form-driven web interface,
but have R do the underlying calculations.
Thanks...
2004 Dec 01
1
typo
In my previous mail the last line was supposed to be:
"It turns out I probably won''t use fork unless support FOR STREAMS is
added to it."
aslak
2004 Oct 04
2
open3 for windows
Hi all,
The topic of creating a unified API for open3 for Windows came up at
RubyConf 2004 this year.
Park, I was wondering if you would mind if we modified win32_popen so that
the API matches the open3 library that ships with Ruby.
This also means deciding whether or not to leave in the open2, open4, and
posix stuff. I guess it doesn''t hurt to leave this in, although Open3.open4
seems a bit off ;) I suppose we could argue that "Open3" was a poorly
chosen module name, but it''s too late now I think.
Also, I had some trouble with win32_popen on XP Home alt...
2006 Mar 10
8
domUloader kernel command line arguments?
domUloader potentially makes my life a lot easier, but from experiments
and looking at the code, it doesn''t seem like there is any way to pass
kernel command line arguments with it. Am I just missing something?
Thanks,
John Byrne
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
2005 Nov 16
2
two-way communication using Unix pipes
Hello,
I am trying to communicate with R from a perl program. Because this code
must be deployed on systems that are outside of my control I do not wish to
pursue the RSperl.pm approach which requires that R be compiled to use
shared libraries.
I have a custom, light weight module I have used with other command line
driven programs like Ferret and Grads. This module follows the standard perl
2003 Apr 20
0
How I got Samba 2.2.8a to run on OpenBSD 3.2 i386
...*:$newuid:32767::0:0::/dev/null:/sbin/nologin\n";
flock(MPW, LOCK_UN);
close MPW;
system($pwd_mkdb, '-p', '-u', $newname, $master_passwd);
die "pwd_mkdb failed!" if $?;
-------------- next part --------------
#!/usr/bin/perl -W
use Fcntl qw(:DEFAULT :flock);
use IPC::Open2;
$pwd_mkdb = "/usr/sbin/pwd_mkdb";
$passwd_tmp = "/etc/ptmp";
$master_passwd = "/etc/master.passwd";
umask(077);
exit if $<;
$username = pop(@ARGV);
exit if !defined $username;
getpwnam($username) or exit;
system(split(/\s+/, "$pwd_mkdb -c $master_passwd&quo...