Re: [R] BRugs Error

2013-02-10 Thread Prof Brian Ripley
On 10/02/13 21:43, David Winsemius wrote: On Feb 10, 2013, at 12:28 PM, Uwe Ligges wrote: On 10.02.2013 21:18, Paul Ossenbruggen wrote: I installed XCode, XQuartz and OpenBUGS on my Mac using WINE. When I tried to test my installation I received the following error. If correct, BRu

Re: [R] Constrained Optimization in R (alabama)

2013-02-10 Thread Berend Hasselman
On 10-02-2013, at 21:16, Axel Urbiz wrote: > Dear List, > > I'm trying to solve this simple optimization problem in R. The parameters > are the exponents to the matrix mm. The constraints specify that each row > of the parameter matrix should sum to 1 and their product to 0. I don't > understan

Re: [R] assign estimated values

2013-02-10 Thread Pete Brecknock
malaka wrote > Hi, > I want to assign the ar1 , ma 1 and the intercept estimated by the > following code to three variables a, b and c respectively. > > Can anyone help me with this please? > > code: > > a0 = 0.05; a1 = 0.1; b1 = 0.85 > nu = rnorm(2500) > epsi = rep(0, 2500) > h = rep(0, 2500) >

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread Jannetta Steyn
Oops, that's not right. The trigger condition should be init[1]>=30. The way I have it now I think init[1]=1. I don't know how to fix that yet because it won't take and if construct ... more reading for me I guess ... Thanks for pointing that out. Jannetta On 11 February 2013 00:09, David Winse

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread David Winsemius
On Feb 10, 2013, at 3:35 PM, Jannetta Steyn wrote: I managed to get it to work (I think). Code below: The output certainly looks more sensible. You commented out the if- reset strategy and are using events. Can you explain how the event code is triggered? I no longer see a definition of a

Re: [R] cumulative sum by group and under some criteria

2013-02-10 Thread Zjoanna
Hi, How to expand or loop for one variable n based on another variable? for example, I want to add m (from m1 to maxN- n1-2) and for each m, I want to add n (n1+2 to maxN-m), and similarly add x and y, then I need to do some calculations. d3<-data.frame(d2) for (m in (m1+2):(maxN-(n1+2)){

Re: [R] R2OpenBUGS quesion

2013-02-10 Thread Dan Polhamus
I just ran into this problem on R2OpenBUGS_3.2-1 using OpenBUGS322 (on Mac Lion through wine). The error is being thrown when attempting to parse the index file in bugs.sims: index <- read.table("CODAindex.txt", header = FALSE, sep=" ") The CODAindex file is now csv, removing the space delimiter

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread Jannetta Steyn
I managed to get it to work (I think). Code below: library(deSolve); Izhikevich <- function(time, init, parms) { with(as.list(c(init, parms)),{ dv <- (0.04*v^2)+(5*v)+140-u+I; du <- a*(b*v-u); #if (v>=30) v<-c else v<-u+d; list( c(dv, du)) })} parms=c( a=0.02, b=0.2, c=-65, d=2

[R] Training with very few positives

2013-02-10 Thread James Jong
I have a binary classification problem where the fraction of positives is very low, e.g. 20 positives in 10,000 examples (0.2%) What is an appropriate cross validation scheme for training a classifier with very few positives? I currently have the following setup: =

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
Sorry, this was meant to go to the full list. -David On Sun, Feb 10, 2013 at 2:15 PM, David Romano wrote: > > > On Sun, Feb 10, 2013 at 1:59 PM, Bert Gunter wrote: > >> Please read the Help before posting. >> >> ?"$" says: >> > > It helps to know that $ must be quoted, so thanks again goes to D

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Bert Gunter
Please read the Help before posting. ?"$" says: "Both [[ and $ select a single element of the list. The main difference is that $ **does not allow computed indices** , whereas [[ does. x$name is equivalent to x[["name", exact = FALSE]]. Also, the partial matching behavior of [[ can be controlled

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Ben Bolker
Duncan Murdoch gmail.com> writes: > > On 13-02-10 4:06 PM, David Romano wrote: > > Hi everyone, > > > > I ran into the issue below while trying to execute a command of the form > > > > apply(list.names,1, function(x) F(favorite.list$x) ) > > > > where list.names is a character vector containing

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
On Sun, Feb 10, 2013 at 1:40 PM, Duncan Murdoch wrote: > On 13-02-10 4:06 PM, David Romano wrote: > >> Hi everyone, >> >> I ran into the issue below while trying to execute a command of the form >> >> apply(list.names,1, function(x) F(favorite.list$x) ) >> >> where list.names is a character vecto

Re: [R] BRugs Error

2013-02-10 Thread David Winsemius
On Feb 10, 2013, at 12:28 PM, Uwe Ligges wrote: On 10.02.2013 21:18, Paul Ossenbruggen wrote: I installed XCode, XQuartz and OpenBUGS on my Mac using WINE. When I tried to test my installation I received the following error. If correct, BRugs does not exist for R 2.15.1.

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Duncan Murdoch
On 13-02-10 4:06 PM, David Romano wrote: Hi everyone, I ran into the issue below while trying to execute a command of the form apply(list.names,1, function(x) F(favorite.list$x) ) where list.names is a character vector containing the names of the elements of favorite.list and F is some functi

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread R. Michael Weylandt
On Sun, Feb 10, 2013 at 9:06 PM, David Romano wrote: > Hi everyone, > > I ran into the issue below while trying to execute a command of the form > > apply(list.names,1, function(x) F(favorite.list$x) ) > > where list.names is a character vector containing the names of the elements > of favorite.l

Re: [R] How to debug the C programs associated with R-packages?

2013-02-10 Thread R. Michael Weylandt
On Sun, Feb 10, 2013 at 4:30 PM, Pulkit Mehrotra wrote: > Dear sir, > > Thank you for your reply and suggestions. Gdb is exactly the thing I was > looking for. Will certainly report the bug on R-devel if found so. More likely (though not impossible that it's otherwise) the bug is in a CRAN (contr

Re: [R] Constrained Optimization in R (alabama)

2013-02-10 Thread Ravi Varadhan
Axel, Your objective function has the wrong sign. The maximum is infinity, so it does not make sense to maximize. YOu should be minimizing the product. So, remove the negative sign and it works as you had expected. ff <- function (x) { mm <- matrix(c(10, 25, 5, 10), 2, 2) matx <- matri

Re: [R] Constrained Optimization in R (alabama)

2013-02-10 Thread Ravi Varadhan
Your constraints are non-sensical. The only way for these constraints to be satisfied is for two of the parameters to be 0 and the other two to be 1. Please spend time to formulate your problem correctly, before imposing on others' time. Ravi From: Axel Ur

[R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
Hi everyone, I ran into the issue below while trying to execute a command of the form apply(list.names,1, function(x) F(favorite.list$x) ) where list.names is a character vector containing the names of the elements of favorite.list and F is some function defined on a list element. Namely, the

Re: [R] BRugs Error

2013-02-10 Thread Uwe Ligges
On 10.02.2013 21:18, Paul Ossenbruggen wrote: I installed XCode, XQuartz and OpenBUGS on my Mac using WINE. When I tried to test my installation I received the following error. If correct, BRugs does not exist for R 2.15.1. Is there a means to get arrange this problem

[R] BRugs Error

2013-02-10 Thread Paul Ossenbruggen
I installed XCode, XQuartz and OpenBUGS on my Mac using WINE. When I tried to test my installation I received the following error. If correct, BRugs does not exist for R 2.15.1. Is there a means to get arrange this problem? Thanks Paul The following code is an exam

[R] Constrained Optimization in R (alabama)

2013-02-10 Thread Axel Urbiz
Dear List, I'm trying to solve this simple optimization problem in R. The parameters are the exponents to the matrix mm. The constraints specify that each row of the parameter matrix should sum to 1 and their product to 0. I don't understand why the constraints are not satisfied at the solution. I

Re: [R] How to debug the C programs associated with R-packages?

2013-02-10 Thread Pulkit Mehrotra
Dear sir, Thank you for your reply and suggestions. Gdb is exactly the thing I was looking for. Will certainly report the bug on R-devel if found so. regards, Pulkit On Fri, Feb 8, 2013 at 9:52 AM, Martin Morgan wrote: > On 02/08/2013 05:13 AM, Pulkit Mehrotra wrote: > >> hello, >> >> I was ha

Re: [R] top 10 (n values) for each classes

2013-02-10 Thread Gabor Grothendieck
On Sun, Feb 10, 2013 at 5:31 AM, catalin roibu wrote: > Dear R users, > I have a problem. I don't know how to select the top 10 (n) values for each > classes. Assuming that by top n values in each group you mean the first n rows in each group then: n <- 5 dat1[ave(dat1$cls, dat1$cls, FUN = seq_a

Re: [R] top 10 (n values) for each classes

2013-02-10 Thread arun
You should have used dput(). Assuming the "," are "." #Using a subset of your example dat1<-read.table(text=" proc cls 7271 568,03338 0,5   7270 554,68458 0,5   7269 510,20638 0,5   7268 485,59969 0,5   7267 421,92852 0,5   7272 410,12101 0,5   3414 409,71429 0,5   3452 402,78699 0,5   3451 401,28

[R] [R-pkgs] glmnet_1.9-1 submitted to CRAN

2013-02-10 Thread Trevor Hastie
This new version of glmnet has some bug fixes, and some new features * new arguments lower.limits=-Inf and upper.limits=Inf (defaults shown) for all the coefficients in glmnet. Users can provide limits on coefficients. See the documentation for glmnet. Typical usage: glmnet(x,y,lower=0) Here t

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread Ben Bolker
On 13-02-10 01:22 PM, David Winsemius wrote: > > On Feb 10, 2013, at 8:09 AM, Ben Bolker wrote: > >> Jannetta Steyn henning.org> writes: >> >>> >>> Hi All >>> >>> It has been suggested to me that the folks in this list might be able to >>> help me out of my misery. >>> >>> As part of my learning

Re: [R] Migrating R packages from svn/R-Forge to git/Github

2013-02-10 Thread Joshua Wiley
Hi Michael, Just to add to what Yihui suggested, I have used Cygwin on all my Windows machines to create a Linux environment for years. It is stable and allows for many features. You can easily get git, svn, and ruby --- I'm not sure about rubygems. Anyway, with a bit of work, I suspect you cou

Re: [R] Migrating R packages from svn/R-Forge to git/Github

2013-02-10 Thread Yihui Xie
In the past Github allows one to import from an existing SVN repository automatically via its web interface, but I just checked it and it seems to have gone. What is left is: https://help.github.com/articles/importing-from-subversion Perhaps it is best for you to do the conversion under Linux and t

[R] Migrating R packages from svn/R-Forge to git/Github

2013-02-10 Thread Michael Friendly
[I'm not sure if this post should go to R-devel, but thought I'd start here for wider readership.] I have a collection of R packages that I maintain using the eclipse/StatET IDE (mainly on Windows) with SVN on the R-Forge system, https://r-forge.r-project.org/users/friendly/ I'd like to cons

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread David Winsemius
On Feb 10, 2013, at 4:22 AM, Jannetta Steyn wrote: Hi All It has been suggested to me that the folks in this list might be able to help me out of my misery. As part of my learning curve to building a rather detailed model of a small neurone complex I am implementing some existing models

Re: [R] Border width on symbols plotted with the lattice package

2013-02-10 Thread Karl Ove Hufthammer
ilai skreiv: > Like this ? > xyplot(4:5~4:5, groups=4:5, lex = 5 , > par.settings = simpleTheme(cex=10, pch=21, lwd=5), > auto.key=TRUE) Thanks, both David and ilai. The ‘lex’ solution seems to work very well. -- Karl Ove Hufthammer E-mail: k...@huftis.org Jabber: huf...@jabber.no

Re: [R] top 10 (n values) for each classes

2013-02-10 Thread Anthony Damico
hi catalin, i thought this was a great question and could not find a good answer on stackoverflow.com, so i have started this thread which asks the question formally. i have also provided one answer that should be sufficient for you, but others may weigh in as well http://stackoverflow.com/questi

Re: [R] A Hodgkin Huxley Model

2013-02-10 Thread Ben Bolker
Jannetta Steyn henning.org> writes: > > Hi All > > It has been suggested to me that the folks in this list might be able to > help me out of my misery. > > As part of my learning curve to building a rather detailed model of a small > neurone complex I am implementing some existing models in R.

[R] A Hodgkin Huxley Model

2013-02-10 Thread Jannetta Steyn
Hi All It has been suggested to me that the folks in this list might be able to help me out of my misery. As part of my learning curve to building a rather detailed model of a small neurone complex I am implementing some existing models in R. For the moment I want to implement the Izhikevich mod

Re: [R] exponential model in R

2013-02-10 Thread Ben Bolker
catalin roibu gmail.com> writes: > > Dear R users, > I don't know how to compute an exponential model like this: > proc=a*exp(b*cls), or proc=a*exp(b*cls)+c*exp(d*cls). Please help me to > solve this problem! > > Thank you! > > My data is: This still doesn't make much sense/have much contex

Re: [R] Correct value of R_HOME

2013-02-10 Thread Prof Brian Ripley
On 10/02/2013 14:38, Uwe Ligges wrote: On 10.02.2013 03:13, James Jong wrote: What is the purpose of the variable R_HOME? What value should I set it to? Don't change it, it is set automatically on startup. See ?R_HOME True for normal use of R, but another question from the OP suggests th

Re: [R] question about reproducibility/consistency of principal component and lda directions in R

2013-02-10 Thread David Romano
On Sat, Feb 9, 2013 at 11:43 AM, Uwe Ligges wrote: > > > On 08.02.2013 20:14, David Romano wrote: > >> Hi everyone, >> >> I'm not exactly sure how to ask this question most clearly, but I hope >> that >> giving the context in which it occurs for me will help: I'm trying to >> compare the brain

[R] exponential model in R

2013-02-10 Thread catalin roibu
Dear R users, I don't know how to compute an exponential model like this: proc=a*exp(b*cls), or proc=a*exp(b*cls)+c*exp(d*cls). Please help me to solve this problem! Thank you! My data is: row.names proc cls 1 0.5 452.616206 0.5 2 1 255.864021 1.0 3 1.5 150.885316 1.5 4 2 86.289600 2.0 5 2.5 56.

Re: [R] Correct value of R_HOME

2013-02-10 Thread Uwe Ligges
On 10.02.2013 03:13, James Jong wrote: What is the purpose of the variable R_HOME? What value should I set it to? Don't change it, it is set automatically on startup. See ?R_HOME Uwe Ligges Thanks, James [[alternative HTML version deleted]] __

Re: [R] Boxplot Issues

2013-02-10 Thread John Kane
Nice boxplot but you forgot to tell us the issues :) John Kane Kingston ON Canada > -Original Message- > From: asir...@gmail.com > Sent: Sat, 9 Feb 2013 08:09:13 -0800 > To: r-help@r-project.org > Subject: [R] Boxplot Issues > > __ > R-help@r

Re: [R] Add text A, B, C and D on multiple ordered plot

2013-02-10 Thread John Kane
It all depends on where you want the text. Did the other two replies that I have seen provide a better solution? If not can you give us some more description of what you want or point to a graph somewhere on the internet so we can get a better idea of what you want? John Kane Kingston ON Cana

Re: [R] help on plotting series with different x-axis values on a graph with one x-axis

2013-02-10 Thread John Kane
No image. png files seem to make it through so if you save as png it should arrive. Some sample code and data would help Is the data in one data.frame or could you put it into one? If so you might want to try melting the data (see reshape 2 package) and plotting with ggplot2 John Kane Kings

Re: [R] compute exponential model with R

2013-02-10 Thread John Kane
We might be able to help if we knew what you are doing. https://github.com/hadley/devtools/wiki/Reproducibility John Kane Kingston ON Canada > -Original Message- > From: catalinro...@gmail.com > Sent: Sun, 10 Feb 2013 13:16:12 +0200 > To: r-help@r-project.org > Subject: [R] compute ex

Re: [R] rpy2 (Python <--> R)

2013-02-10 Thread Suzen, Mehmet
Wrong list. You may want to ask here: http://rpy.sourceforge.net/maillist.html But looking at your output it looks like you need to install readline library sources or be sure that it is in the CFLAGS's -I On 10 February 2013 06:06, James Jong wrote: > Hi - I am having trouble installing rpy2. I

[R] compute exponential model with R

2013-02-10 Thread catalin roibu
Dear R users, Please help me to compute an exponential model with R. Thank you! -- --- Catalin-Constantin ROIBU Forestry engineer, PhD Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53 18 01

Re: [R] top 10 (n values) for each classes

2013-02-10 Thread andrija djurovic
Hi, see function ?head or "[". If DF is you data frame, top n values of DF you can select with head(DF, n) or DF[1:n, ]... Andrija On Sun, Feb 10, 2013 at 11:31 AM, catalin roibu wrote: > Dear R users, > I have a problem. I don't know how to select the top 10 (n) values for each > classes. > T

Re: [R] a problem of approach

2013-02-10 Thread Adrian Duşa
Dear Petr, On Wed, Jun 27, 2012 11:02:39 am, Petr Savicky wrote: > > How large the numbers are? If the bound 3^14 = 4782969 used above apply also > to the real situation, > then it is possible to represent the set using a logical vector of this > length, which has TRUE for the numbers > present

[R] top 10 (n values) for each classes

2013-02-10 Thread catalin roibu
Dear R users, I have a problem. I don't know how to select the top 10 (n) values for each classes. Thank you! My data is like this: row.names proc cls 7271 568,03338 0,5 7270 554,68458 0,5 7269 510,20638 0,5 7268 485,59969 0,5 7267 421,92852 0,5 7272 410,12101 0,5 3414 409,71429 0,5 3452 4

[R] Statistics of prediction for multiple models with caret

2013-02-10 Thread James Jong
I am trying to get statistics of prediction for binary classification problems and for various training models with caret. Below is an example that illustrates my need: -- library(caret) # ... Get X and Y for training a binary classification problem. X is i