Re: [R] R user interface

2010-06-17 Thread Greg Snow
One possibility (there are others as well) is write your own function that given the name of the country will grab the data and create the plot that you want. Then use the tkexamp function in the TeachingDemos package to create the GUI for this function. Other options (which I am less familiar

Re: [R] Pretty printing progress

2010-06-17 Thread Greg Snow
Others mentioned progress bars and sprintf, one other option is to use a named vector and let R to the formatting: > tmp <- c(10, -1234) # or variables to put the values in > names(tmp) <- c('Iteration', ' Log Likelihood') > print(tmp) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Stati

[R] Read code from character string

2010-06-17 Thread Johannes Huesing
Dear expRts, I have a character string, say a <- "print(9**2)". How do I execute the contents of the string, parsed as R code? Do I have to open a connection and use cat(a), and parse it at the other end? Cheers Johannes -- Johannes Hüsing There is something fascinating about sci

Re: [R] program R using mac Xcode

2010-06-17 Thread Charles C. Berry
On Thu, 17 Jun 2010, Waverley @ Palo Alto wrote: Hi, I am starting to use Xcode a lot for C/C++ programming. Can you do R programming in Xcode? If can, how to configure to enable this? Better to post to R-sig-mac for this question. Refer to Writing R Extensions and R for M

Re: [R] Read code from character string

2010-06-17 Thread Peter Langfelder
eval(parse(text="print(9**2)")) On Thu, Jun 17, 2010 at 12:32 PM, Johannes Huesing wrote: > Dear expRts, > I have a character string, say a <- "print(9**2)". How do I execute > the contents of the string, parsed as R code? Do I have to open a > connection and use cat(a), and parse it at the other

[R] Factoring a variable

2010-06-17 Thread Noah Silverman
Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no", "no", "no", "yes", "yes",

Re: [R] Factoring a variable

2010-06-17 Thread Erik Iverson
Noah Silverman wrote: Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no",

Re: [R] Factoring a variable

2010-06-17 Thread Henrique Dallazuanna
Use factor indeed as.factor: factor(x, levels = c('yes', 'no')) On Thu, Jun 17, 2010 at 4:47 PM, Noah Silverman wrote: > Hi, > > I have a dataset where the results are coded ("yes", "no") We want to > do some machine learning with SVM to predict the "yes" outcome > > My problem is that if I jus

[R] [OT] Oo-calc & StAtistics

2010-06-17 Thread Ted Harding
The thread "R licensing query" currently running has raised the classic critcisms of using Excel for statistics. I was wondering: Has anyone applied the same or similar set of tests to OpenOffice "calc"? Or would the Executive Summary be: "Calc is just like Excel"? (Not that I'm a spreadsheet us

Re: [R] RODBC in R

2010-06-17 Thread Bart Joosen
As Marc already pointed out, you masked your pwd with , but you didn't correctly used the arguments. "your ODBC connection" is the name of your ODBC connection you setup in your environment. Like "postgresql35W" or something I can't write out a complete syntax when I don't know your actual O

[R] Modifyiing R working matrix within "gee" source code

2010-06-17 Thread ZZY ZYBOYS
Dear all, I am working on modifying the R working matrix to commodate some other correlations that not included in the package. I am having problem to locate where the R matrix are defined for regular matrices, i.e. independence, exchangeable, AR and unstructure. it might have something within .C(

[R] help for reshape function

2010-06-17 Thread xin wei
hi, everyone: i have a question on the reshape function. i have the following dataset : gene tissuepatient1 patient2 patient3. _ gene1 breast 10 20 50 gene2 breast 20 40 60 gene3 br

Re: [R] RKWARD

2010-06-17 Thread Joris Meys
Please ask that question again on the right place : https://lists.sourceforge.net/lists/listinfo/rkward-users And quite likely, it is just because you saved the previous workspace which gets loaded automatically when you start R. Cheers Joris On Thu, Jun 17, 2010 at 12:31 PM, n.via...@libero.it

[R] Factoring a variable

2010-06-17 Thread Noah Silverman
Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no", "no", "no", "yes", "yes",

Re: [R] help for reshape function

2010-06-17 Thread Henrique Dallazuanna
Try this: reshape(x, direction = 'long', varying = list(3:5), timevar = "gene", v.names = "value") On Thu, Jun 17, 2010 at 3:22 PM, xin wei wrote: > > hi, everyone: > > i have a question on the reshape function. i have the following dataset : > gene tissuepatient1 patient2 patient3..

Re: [R] [OT] Oo-calc & StAtistics

2010-06-17 Thread Marc Schwartz
On Jun 17, 2010, at 3:03 PM, Ted Harding wrote: > The thread "R licensing query" currently running has raised > the classic critcisms of using Excel for statistics. > > I was wondering: Has anyone applied the same or similar set > of tests to OpenOffice "calc"? > > Or would the Executive Summary

Re: [R] Factoring a variable

2010-06-17 Thread Steve Lianoglou
Hi, On Thu, Jun 17, 2010 at 3:45 PM, Noah Silverman wrote: > Hi, > > I have a dataset where the results are coded ("yes", "no")  We want to > do some machine learning with SVM to predict the "yes" outcome > > My problem is that if I just use the as.factor function to convert, then > it reverses t

Re: [R] [OT] Oo-calc & StAtistics

2010-06-17 Thread Ted Harding
On 17-Jun-10 20:36:27, Marc Schwartz wrote: > On Jun 17, 2010, at 3:03 PM, Ted Harding wrote: >> The thread "R licensing query" currently running has raised >> the classic critcisms of using Excel for statistics. >> >> I was wondering: Has anyone applied the same or similar set >> of tests to Open

Re: [R] [OT] Oo-calc & StAtistics

2010-06-17 Thread Marc Schwartz
On Jun 17, 2010, at 4:29 PM, Ted Harding wrote: > On 17-Jun-10 20:36:27, Marc Schwartz wrote: >> On Jun 17, 2010, at 3:03 PM, Ted Harding wrote: >>> The thread "R licensing query" currently running has raised >>> the classic critcisms of using Excel for statistics. >>> >>> I was wondering: Has an

[R] help with neural network nnet package

2010-06-17 Thread Changbin Du
HI, Dear R community, I am using the nnet to fit a neural network model to do classification on binary target variable (0, 1). I am using the following codes: nnet.fit<-nnet(as.factor(out) ~ ., data=train, size=5, rang=0.3, decay=5e-4, maxit=500) I want to know what is the activation function f

Re: [R] t-test problem

2010-06-17 Thread Worik R
Ted this was very helpful. To be crystal clear I'll rephrase you. What I am interested in is the probability that my 'T' is in the tail. For a two sided test I do not care which tail. Since (all things being equal) the distribution of T is around 0 if the my T is greater than 0 I compare it to

[R] help with nnet

2010-06-17 Thread Changbin Du
> nnet.fit<-nnet(as.factor(out) ~ ., data=all_h, size=5, rang=0.3, decay=5e-4, maxit=500) # model fitting > summary(nnet.fit) a 23-5-1 network with 126 weights options were - entropy fitting decay=5e-04 HI, Guys, I can not find the manual to describe how the model is built, is there a more

Re: [R] Cforest and Random Forest memory use

2010-06-17 Thread Raubertas, Richard
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Max Kuhn > Sent: Monday, June 14, 2010 10:19 AM > To: Matthew OKane > Cc: r-help@r-project.org > Subject: Re: [R] Cforest and Random Forest memory use > > The first thing that

[R] ask a question about data sets element

2010-06-17 Thread song song
for example, I have a1=c(1,3,5) a2=c(2,4,6) a3=c(7,8) a4=c(9,10) now if I have i=5, so i in a1, then I get a feedback tag[5]=1 i=8, so i in a3, then can get tag[8]=3 in there any function to do this to check the element belongs to which group? thank you!!! [[alterna

Re: [R] ask a question about data sets element

2010-06-17 Thread Erik Iverson
song song wrote: for example, I have a1=c(1,3,5) a2=c(2,4,6) a3=c(7,8) a4=c(9,10) now if I have i=5, so i in a1, then I get a feedback tag[5]=1 i=8, so i in a3, then can get tag[8]=3 in there any function to do this to check the element belongs to which group? thank you!!!

[R] RJDBC - sloooooow - HELP!

2010-06-17 Thread Ralf B
Hi all, I am suffering from a very slow RJDBC (7 rows of from a simple select take like 10 minutes). Does anybody know if RMySQL is faster? Or RODBC in that respect? What are alternatives and what can be done to get a realistic performance out of MySQL when connected to R's JRI ? Best, Ralf

[R] Speeding up the transfer of a tcl character array to R

2010-06-17 Thread Gabor Grothendieck
What is the best way to transfer a character array from tcl to R. 1. This works but its very slow if the tcl variable, r, is long: n <- as.numeric(tclvalue(.Tcl("llength $r"))) sapply(seq(0, length = n), function(i) tclvalue(.Tcl(paste("lindex $r", i 2. This also works and is fast but having

Re: [R] ask a question about data sets element

2010-06-17 Thread Henrique Dallazuanna
You could try this: i <- c(5, 8) a <- list(a1, a2, a3, a4) subset(stack(as.data.frame(sapply(a, '[', 1:max(sapply(a, length), values %in% i, ind) On Thu, Jun 17, 2010 at 8:40 PM, song song wrote: > for example, I have > > a1=c(1,3,5) > a2=c(2,4,6) > a3=c(7,8) > a4=c(9,10) > > now if

Re: [R] [ADMB Users] an alternative to R for nonlinear stat models

2010-06-17 Thread Chris Gast
I spoke with my colleague who did most of the testing, and he has informed me that much of the hessian sensitivity actually came from a separate program (based on Numerical Recipes in C++ code) that did not use optim(), after having stopped using optim() due to speed issues. In my experience with

Re: [R] [ADMB Users] an alternative to R for nonlinear stat models

2010-06-17 Thread Chris Gast
As an additional note, the parscale argument can be useful to improve stability in convergence results in optim(). Chris - Chris Gast cmg...@gmail.com On Thu, Jun 17, 2010 at 1:32 PM, Chris Gast wrote: > I spoke with my colleague who did most of the testing, and

Re: [R] tune svm

2010-06-17 Thread Yen Low
svm requires that your x input be a numeric matrix. The double quotes denote character values in your matrix, probably introduced as a result of conversion from a data frame. To convert to a numeric matrix and remove the double quotes: mode(mdt01bis) <- "numeric" -- View this message in context:

[R] Multiple ecdf plots?

2010-06-17 Thread weller
I have a csv file that has approximately 50k rows. In the first value of each row, a file name is listed, and there are 162 different file names. At the end of each row, there is a number value. What I would like to be able to do is for the 162 different files (or we could call them categories)

Re: [R] Is there a non-parametric repeated-measures Anova in R ?

2010-06-17 Thread David Winsemius
On Jun 16, 2010, at 1:43 PM, Tal Galili wrote: Hello Jeremy, Thank you for replying. I came across friedman test (I even wrote and published R code to easily perform a post-hoc analysis of friedman test ).

[R] Drawing paths through a grid

2010-06-17 Thread Rex C. Eastbourne
I would like to draw a set of points that are equally spaced in a 2-D grid. Then I would like to draw lines that illustrate different directed paths through subsets of points. Imagine that the points correspond to booths in a conference center, and I want to show the various paths people took to vi

[R] is there a function to find the quantile of the mean of a vector?

2010-06-17 Thread David LeBauer
Hello, I am interested in finding the quantile of the mean of a vector, something analogous to using the pnorm(), but for an mcmc chain instead of a distribution with known parameters. One approach would be to write a function that finds the index of x_i that minimizes (x-mean(x))^2 I suspect th

Re: [R] is there a function to find the quantile of the mean of a vector?

2010-06-17 Thread Jorge Ivan Velez
Hi David, You might try: > set.seed(1) > x <- runif(10, 3, 7) > x [1] 4.062035 4.488496 5.291413 6.632831 3.806728 6.593559 6.778701 5.643191 5.516456 3.247145 > (x-mean(x))^2 [1] 1.308783661 0.514892188 0.007285983 2.035688832 1.958118177 1.925165288 2.473214156 [8] 0.191087609 0.096348590 3.

Re: [R] Multiple ecdf plots?

2010-06-17 Thread David Winsemius
On Jun 17, 2010, at 4:46 PM, weller wrote: I have a csv file that has approximately 50k rows. In the first value of each row, a file name is listed, and there are 162 different file names. At the end of each row, there is a number value. What I would like to be able to do is for the 1

Re: [R] Is there a non-parametric repeated-measures Anova in R ?

2010-06-17 Thread Frank E Harrell Jr
On 06/17/2010 07:12 PM, David Winsemius wrote: On Jun 16, 2010, at 1:43 PM, Tal Galili wrote: Hello Jeremy, Thank you for replying. I came across friedman test (I even wrote and published R code to easily perform a post-hoc analysis of friedman test

Re: [R] help for reshape function

2010-06-17 Thread xin wei
I am afraid that your solution is not solving the problem. it seems that timevar="gene" just create the followings: GENESAMPLE value id 1.11 Kidney 3.69351 1 2.11 Kidney 5.42710 2 3.11 Kidney 5.26883 3 4.11 Kidney 2.88098 4 5.11 Kidney 4.68519

Re: [R] Drawing paths through a grid

2010-06-17 Thread baptiste auguie
Hi, Try this, ## create a 2D grid with random point sizes d = expand.grid(x=1:10,y=1:10) d$size = runif(nrow(d), 1,5) ## create some random links links= d[sample(seq(1,nrow(d)),20),] links$id = sample(2:6, nrow(links),repl=T) ## plot library(ggplot2) ggplot(d, mapping=aes(x,y)) + geom_point(

[R] Find the 50 highest values in a matrix

2010-06-17 Thread uschlecht
Hi, I have a huge matrix (4000 * 2000 data points) and I would like to retrieve the coordinates (column and row) for the top 50 (or x) values. Some positions in the matrix have NA as a value. These should be discarded. My current method is to replace all NAs by 0, then rank all the values and

Re: [R] Drawing paths through a grid

2010-06-17 Thread Tal Galili
Hi Rex, It sounds like something that can be done with ?lines If you would supply with a simple self contained data that represents what you are trying to plot, then we might be able to better help you. If you have the data in R, use "dput" to be able to copy paste it into the email. Cheers, Tal

[R] 12th Root of a Square (Transition) Matrix

2010-06-17 Thread Corey Gallon
Dear R-tisans, I am trying to calculate the 12th root of a transition (square) matrix, but can't seem to obtain an accurate result. I realize that this post is laced with intimations of quantitative finance, but the question is both R-related and broadly mathematical. That said, I'm happy to

[R] Latex problem in Hmisc (3.8-1) and Mac Os X with R 2.11.1

2010-06-17 Thread moleps islon
Dear all, I did post this more or less identical mail in a follow up to another question I posted, but under another heading. I try again, but now under the correct header. upon running this code (from the Hmisc library-latex function) I believe the call to summary.formula is allright and produc

Re: [R] Read code from character string

2010-06-17 Thread Johannes Huesing
Peter Langfelder [Thu, Jun 17, 2010 at 09:38:45PM CEST]: > eval(parse(text="print(9**2)")) cheers, I overlooked the text option. > > On Thu, Jun 17, 2010 at 12:32 PM, Johannes Huesing > wrote: > > Dear expRts, > > I have a character string, say a <- "print(9**2)". How do I execute > > the con

Re: [R] help for reshape function

2010-06-17 Thread Joshua Wiley
Hello, Try this, it is based off of your sample wide format data. I am not quite sure how you got the 'gene1' column in your desired output data, it looks like it is just the data from patient1, but since I was not sure, I did not include it. ## temp <- data.frame

Re: [R] [ADMB Users] an alternative to R for nonlinear stat models

2010-06-17 Thread Rubén Roa
De: Chris Gast [mailto:cmg...@gmail.com] Enviado el: jueves, 17 de junio de 2010 22:32 Para: Rubén Roa CC: r-help@r-project.org; us...@admb-project.org Asunto: Re: [ADMB Users] an alternative to R for nonlinear stat models

Re: [R] No graphics capability on fresh install of R2.11.0 on FreeBSD 8.0

2010-06-17 Thread Rainer Hurling
On 17.06.2010 04:45 (UTC+1), Ben Madin wrote: G'day all, Hi Ben, I am working on a new FreeBSD 8.0 Server (remotely located), and have installed (now several times) R 2.11.0 but I cannot get any graphic outputs (everything else seems to be happening fine...) i'm also working with FreeBSD

Re: [R] Optimization problem

2010-06-17 Thread José E. Lozano
> How about smoothing the percentages, and then take the second derrivative to find the inflection point? > > which.max(diff(diff((lowess(percentages)$y This solution is what I've been using so far. The only difference is that I am smoothing the 1st derivative, since its the one I want to be s

Re: [R] Find the 50 highest values in a matrix

2010-06-17 Thread Nikhil Kaza
Matrix is just a vector. So order should work haven't verified the following code. a <- matrix(rnorm(4000*2000), 4000, 2000) b <- order(a, na.last=TRUE, decreasing=TRUE)[1:50] use %% or %/% to get the row# and column #s Nikhil Kaza Asst. Professor, City and Regional Planning University of Nor

Re: [R] Optimization problem

2010-06-17 Thread José E. Lozano
Hello: > Here is a general approach using smoothing using the Gasser-Mueller kernel, > which is implemented in the "lokern" package. The optimal bandwidth for > derivative estimation is automatically chosen using a plug-in approximation. > The code and the results are attached here. Maybe am I

<    1   2