r

edge sequence by vertex name

Hy Everybody! Well, I'm working with the Igraph package, and i'd like to pick the edges by the name that I've assigned to their vertex, in a tiny example.. library(igraph) g <- barabasi.game(8) labels<-c("G1","G2","G3","T1","T2","T3","H1","H2") V(g)$name<-labels Now My edge list hast this form > E(g) Edge sequence: [0] G2 ->...

Assigning and removing objects in a loop: eval(parse(paste(...

I am looking to assign objects in a loop. I've read that some form of eval(parse( is what I need to perform this, but I'm running into errors listing invalid text or no such file or directory. Below is sample code of generally what I'm attempting to do: x <- array(seq(1,18,by=1),dim=c(3,2,3)) for (i in 1:length(x[1,1,])) { eval(parse(...

R: how to change lattice (levelplot) color theme?

The default theme on my installation is something which maps the values to pink and cyan. How to change it for example to a gray scale theme? ...

Read HTML Table in R - Troubleshooting

Hi All, I have seen a number of posts here that describe how to parse HTML tables using the XML package. That said, I have got my code to work except that my first data row gets read in as my column names. My code is taken from the answser at this link How can I get around this? Many thanks, Brock ...

Reset R instance

Is it possible to reset an instance of R? Eg. if I have used the commands x <- 1:10 plot(x, -x) And thus polluted the system with the x variable. In this state can I then revert back to a clean state without shutting R down and launching it again? ...

R: merging matrices (not data.frames)

merge is a very nice function: It merges matrices and data.frames, and returns a data.frame. Having rather big character matrices, is there another good way to merge - without data.frame conversion? Comment 1: A small function to merge a named vector with a matrix or data.frame. Elements of the vector can link to multiple ent...

Change summary variables returned by Hmisc summary()

Is there an easy way to get ride of the traditional quartiles returned by summary.formula with method="reverse" from the Hmisc R library? I would like to get the Mean/SD + Min/Max for each of my continuous variable but didn't succeed. It is possible to pass a custom function call through the argument fun, but it doesn't work when method=...

Strange error merging data frames

I am getting a novel error message, which I am unable to debug. I have two data sets x, x2: ID returns.x returns.y 111111118 0.012852 -0.001436 1145JXAP4 0.000000 0.025316 114LYTBB1 -0.090909 0.100000 114R88BT4 0.000000 0.000000 114Y4KDH0 -0.055344 -0.094950 1198CUV40 0.016043 0.005263 and ID returns 1...

get output as a vector in R during a loop

How can I get the output as a vector in R? For example, if I want to have for (i in 1:1000) {if i mod 123345 = 0, a = list(i)} a but I would want to find all i that divide evenly into 123345 (i.e., factors), and not just the largest one. ...

same regression, different statistics (R v. SAS)?

I ran the same probit regression in SAS and R and while my coefficient estimates are (essentially) equivalent, the reported test statistics are different. Specifically, SAS reports test statistics as t-statistics whereas R reports test statistics as z-statistics. I checked my econometrics text and found (with little elaboration) that it...

Trying to fit a graph in R

Hi , This is my data set what i am trying to do is draw a graph TAD Vs IPRE,DV,PRED as a whole which i have no issues in producing them. Second part is I am trying to produce an individual graph for ID (n=35) so 35 graph for (TAD Vs IPRE,DV,PRED) Third Part is to try and produce a graph based on Ward (TAD Vs IPRE,DV,PRED) which will h...

ggplot2 and reshape2

I have glad to hear that there is an updated version for reshape2 package. I installed the package, but discovered that ggplot2 package still insist to have the reshape package, rather than the reshape2 package, as I manually removed the reshape package and then ggplot2 cannot run. Anything I can do to fix it? Thanks! ...

R: Entering variables into regression function

I have this feature_list that contains several possible values, say "A", "B", "C" etc. And there is time in time_list. So I will have a loop where I will want to go through each of these different values and put it in a formula. something like for(i in ...) and then my_feature <- feature_list[i] and my_time <- time_list[i] then i put ...

Sending a string from R to C++

There are lots of examples of sending integers to C++ from R, but none I can find of sending strings. What I want to do is quite simple: SEXP convolve(SEXP filename){ pfIn = fopen(filename, "r"); } This gives me the following compiler error: loadFile.cpp:50: error: cannot convert 'SEXPREC*' to 'const char*' for argument '1' to 'FI...

How does one install 'rj' in StatET plugin for Eclipse?

I have started to try to use StatET and Texlipse with a view to producing SWEAVE reports. When starting the R console in the StatET plug-in for Eclipse (OS X 10.6.4), I get the message: [INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized. Information on http://www.walware.de/goto/statet states: "The packa...

Is there a good tutorial on setting up the Augustus PMML scoring engine as a web service?

I know it is possible, but the provided documentation here: http://code.google.com/p/augustus/ is thin. The documentation for setting up the web service states: "Configuring the Augustus PMML consumer is covered in great detail elsewhere so we will limit our discussion to what is needed to get the consumer to accept data via HTTP, ...

R - How to 'time' delays as well as user input

What would be a good way to create a timer in R. One that would require little system resources. So far I have a simple delay: t1=as.numeric(format(Sys.time(), "%s")); t2=t1; while (t2-t1<5) t2=as.numeric(format(Sys.time(), "%s")); And the corresponding timer: t1=as.numeric(format(Sys.time(), "%s"));t2=t1; [Event] t2=as.numeric(...

Allocating a larger object in R?

I'm slightly confused on the following point: I am running R on 32-bit Windows. My understanding is that I should be able to allocate up to 2GB. I read though help("Memory") and launched my R session with the flag RGui.exe --max-mem-size=1000M. Then confirmed this within R: > memory.limit() [1] 1000 But when I run a particular op...

See the exact byte sequence of an R string?

How can I get the byte sequence of a particular UTF-8 string? I'm seeing what looks like some bug in the regex engine which is only triggered in some edge cases, and I'd like to know exactly what data it's working on. ...

Embed an R process in a VBA macro

the title exactly -- is there a way to call an r process from an excel macro? ...