Displaying 20 results from an estimated 3000 matches similar to: "characters in a string"
2010 Sep 26
2
get absolute file path
Hello,
I get a value which stores a relative file name. (I get it from another
function, which I don't want to change.)
e.g.
> fileName <- "../data/2010-08.csv";
Is it possible to get the absolute file path out of this value?
(e.g. /home/sebastian/documents/data/2010-08.csv)
Kind regards,
Sebastian
2010 Sep 28
1
How to convert SEXP to double
Hello All,
A simple question.
I get some return from the R in my C++ program (via Rcpp package). The
result come, as SEXP and it should be a simple numeric variable.
How to convert it to double?
The code, what i use:
stringstream ss;
ss << "p <- predict(fit_ar11, n.ahead = 2, doplot=FALSE);"
<< "p$pred[1]";
SEXP ans;
int iRet =
2010 Aug 14
1
Creating list from a long vector
Stupid question, but its been a long night.
If I have a long vector how can I turn it into a list of the same length
x<-rep(seq(1,100,by=1),each=10)
[[alternative HTML version deleted]]
2010 Aug 16
2
Random Number Generators and Sample
I am trying to get documentation about the random number generator used in
"sample". The help for sample does not mention it. Can anyone point me in
the right direction.
Thanks
[[alternative HTML version deleted]]
2010 Aug 20
1
Rserve (Anyone?)
REXP has an asBytes() method. Will this capture the output of an R plot
function if a proper graphics device is used? It appears R insists on
sending plot output to a file. Kind of strange since it insists on loading
all your data into memory before it can do anything.
If so then does anyone know what this would be? I prefer png or jpeg.
Example:
c is an RConnection
REXP r =
2010 Aug 20
1
R and Java
Hi folks,
Maybe that is not the best place to ask, but I 'd like some of you could
help me...
I'm using jri to run R commands under Java, by its examples I can eval
expressions, returning single values or vectors to my Java variables. But, I
would like to know how to assign the values of a Java vector (like: double
x[] = {1.7 , 2.8 , 3.4}; ) to a R variable, so I can eval a function
2010 Sep 06
1
c++ equivalent switch statement?
Is there a c++ equivalent switch statement in R?
--
Rajesh.J
[[alternative HTML version deleted]]
2010 Sep 01
2
Using packages built in linux in windows
Hi,
I built a package in linux and would like to use it in windows. I cant build
the package again in windows because it would miss the necessary libraries
etc(I'm using Rcpp). So I need to generate a binary version and try to
install it in windows. I tried this and I get the error
/cygdrive/RTools/bin/cp: target 'xf->>' is not a directory
Can someone help me with this?
--
2010 Sep 08
3
adding list to data.frame iteratively
Hi,
I have a preallocated dataframe to which I have to add a list whose vectors will become rows in the dataframe. This is done iteratively. How can I do this?
I'm dealing with very large numbers...list of 1000 vectors to a dataframe of 200000 iteratively
for e.g.
my list is as follows
ll<-list(c("1","2","3"),c("2","3","4"))
I
2010 Sep 06
3
representing NULL values in a vector
Hi,
I have a vector who contents should look like this,
"c" "d" NULL "e" "f" etc
or
4 5 6 NULL 7 8 9
how can I represent the null value?
[[alternative HTML version deleted]]
2010 Oct 01
3
Converting a dataframe column from string to datetime
Hi,
I have a dataframe column of the form
v<-c("Fri Feb 05 20:00:01.43000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:06.34000 2010")
I need to convert this to datetime form. I did the following..
lapply(v,function(x){strptime(x, "%a %b %d %H:%M:%OS %Y")})
This gives me a list that looks like
2010 Sep 08
1
bigmemory doubt
Hi,
Is it possible for me to read data from shared memory created by a vc++ program into R using bigmemory?
[[alternative HTML version deleted]]
2010 Sep 04
1
return from .Call()
Hi,
I have a .Call in my R function in a loop that repeats a certain number of times. Each time, the .Call returns a list. So, when I say something like,
y<-func()
would y be a list of lists?(as many as the number of loops?)
[[alternative HTML version deleted]]
2010 Sep 06
1
max limit of list size and vector size?
Hi,
Is it possible for me to store a list of vectors of 1 million entries?
like,
cc<-list(c(1,2,........1million),c(1,2,........1million)....)
also
what is the length of the longest string in R? I keep getting info from a socket and keep pasting on a string...when will this start becoming a problem?
[[alternative HTML version deleted]]
2010 Sep 06
1
size limit of string/parse a string and convert to vector
Hi,
I have a loop as follows,
dataStr <- character(0)
repeat{
fstr<-read.socket(sockfd)
if(fstr=="")
break
dataStr<-paste(dataStr,fstr)
}
at what point does dataStr stop accepting(gets full)? I'm sending millions of records over the socket and need to know if all of it can go into dataStr.
Also, Incase all of it cannot go into dataStr, I need to parse each
2010 Sep 07
1
queue implementation?
Hi,
is there a queue implementation in R?
[[alternative HTML version deleted]]
2010 Sep 08
2
Uncompressing data from read.socket
Hi,
Is it possible to uncompress gzipped data coming over a socket?
[[alternative HTML version deleted]]
2010 Sep 06
2
dataframe row names from list
Hi,
I have a list which looks like this...
> str(y)
List of 10
$ : chr [1:4] "ABCD" "5" "0" "1"
$ : chr [1:4] "DEF" "15" "1" "16"
$ : chr [1:4] "AAA" "2" "17" "8"
$ : chr [1:4] "SSS" "15" "25" "1"
$ : chr [1:4] "III"
2010 Oct 04
2
Issue with match.call
Hi,
I have a function that I'm writing. The arguments in the function are as follows
RFF<-function(qtype, qOpt,...){}
i.e., I have two args that are compulsary and the rest are optional. Now when my user passes the function call, I need to see what optional args are defined and process accordingly...what I have so far is..
RFF<-function(qtype, qOpt,...){
mc <-
2010 Aug 13
2
cacheSweave / pgfSweave driver for package vignette
Dear list,
I wish to use a specific driver to process an sweave document in the
inst/doc directory of a package. Specifically, I would like to use
either cacheSweave or pgfSweave to speed up the creation of the
vignette which requires lengthy computations. The same request would
also apply to the highlight driver, to provide syntax highlighting of
R chunks.
In "writing R extensions" I