Displaying 6 results from an estimated 6 matches for "michael_shen".
2005 Mar 06
3
Search and convert string function
Hi all,
I want to do this kind of function In R enviroment :
For example :
R <- 4
testString <- "I love $R"
then search this testString, when find "$R",replace "$R" to R ,and because
the value of R is 4
So the final string I want to get is "I love 4"
How can I implement? Thanks advance
Michael
2005 Mar 22
1
I modify my question in "textconnection output"
dear ALL-R-helper:
I modify my question in "textconnection output":
I wrote one function in Rgui:
output <- function(y){
x <- textConnection("foo","w")
sink(x)
a <-5
b <-6
z <-a*b
z
e <-"spss"
h <-c(1,2,3)
ls()
r<-c("s","p","s","s")
p<-list(1:10)
p
y <- foo
sink()
2005 Apr 01
2
about get stdout from other program
Dear all R-helper,
if I want to use stdout from other language as my R program input ,which is
the best way for design the API,using Pipe function or produce a temporary
file,using scan function to read the file ?
thanks
Michael
2005 May 10
0
about sink and scan
Hi All r-helper,
my question like this:
I use "sink" function to get output into one file,during the sink process ,
output keep writing into this file,I want to check is there any new output
write into this file(which "sink function create"), using "scan" function to
read new output from that file.
if I use the cat with "\n" ,and
2005 Apr 14
1
question about "R get vector from C"
Dear ALL-R helpers,
I want to let R get vector from c ,for example :numeric array ,vector .I saw
some exmple like this :
/* useCall3.c */
/* Getting an integer vector from C using .Call */
#include <R.h>
#include <Rdefines.h>
SEXP setInt() {
SEXP myint;
int *p_myint;
int len = 5;
PROTECT(myint = NEW_INTEGER(len)); // Allocating
2005 Apr 18
1
how to use sink.number()
Dear All R-helper,
my question is how to use sink.number.
if I want to label the output was sinked by sink function how should I do ?
example:
zz <- file("c:\\sinktest1.txt",open="wt")
sink(zz)
g<- 1:10
cat(g,"\n")
f<-list(1:100)
h<-capture.output(f)
cat(h)
sink()
I want there are marks in "sinktest1.txt" files, let me know the number of