Re: [R] how to speed up the process of R

2012-03-15 Thread Joshua Wiley
I think you would also get a speedup by instantiating your list at size. For example: a <- vector("list", 10) so that memory is already set aside and there is not incremental copying and increasing (although R may be clever and manage to avoid this for you). It is really rather difficult to

Re: [R] how to speed up the process of R

2012-03-15 Thread Joshua Wiley
Hi, Compare this: a<-list() system.time(for(i in 1:10){ a[[i]]<-i*1000 }) system.time(a2 <- as.vector(1000 * (1:10), "list")) all.equal(a, a2) ## > system.time(for(i in 1:10){ ## + a[[i]]<-i*1000 ## + }) ##user system elapsed ## 28.660.02 28.84 ## > system.time(a2 <- as

[R] how to speed up the process of R

2012-03-15 Thread mrzung
hi I'm simulating some experiment by "for" function. The problem is that it takes too much time. for example, a<-list() for(i in 1:1){ a[[i]]<-i*1000 } is there anyway to speed up the process? I heard there is solution but i don't have idea. Can anyone help me? -- View this message i

Re: [R] substituting own test statistics in a built-in function

2012-03-15 Thread Aparna Sampath
Hi Sarah Goslee Thanking you for replying to my doubt. I downloaded the multtest package from CRAN and also went through the package specific PDF file, they have given a list of functions which includes the mt.transformV, mt.checkothers etc, that I am trying to access which they call as the inter

Re: [R] Integrating R project into your product

2012-03-15 Thread Steve Lianoglou
Hi, On Fri, Mar 16, 2012 at 12:17 AM, AGGARWAL, NEERAJ (NEERAJ) wrote: > Hi All, > > We have a product that performs ETL on files and finally load the database. > We want to give the web based interface displaying graphs (that are generated > using R-project forcasting) from this database. > But

[R] Integrating R project into your product

2012-03-15 Thread AGGARWAL, NEERAJ (NEERAJ)
Hi All, We have a product that performs ETL on files and finally load the database. We want to give the web based interface displaying graphs (that are generated using R-project forcasting) from this database. But R-Project is stand alone desktop based software and it takes commands at command l

Re: [R] variable values in plotmath expressions

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 10:25 PM, Richard M. Heiberger wrote: > ## I would like help in using variable values in plotmath expressions > ## in lattice > > x <- 1:10 > y <- 1:10 > pval <- .95 > > plot(y ~ x, ## works as I want in base graphics >     main=substitute(list(alpha * " = " * group("",list

Re: [R] variable values in plotmath expressions

2012-03-15 Thread Joshua Wiley
Hi Rich, I'm not sure if you have a reason outside this toy example to want to be using list() and group(), but if not I would go with this: xyplot(y ~ x, main = substitute(expression(alpha == p), list(p = pval))) Hope this helps, Josh On Thu, Mar 15, 2012 at 7:25 PM, Richard M. Heiberger wro

Re: [R] summing "transfers"

2012-03-15 Thread Jeff Newmiller
Then save to a variable, and maybe then to a file? Are you wanting it in long form? You can use reshape if so. Note that a reproducible example and sample result always helps prompt more specific answers. --- Jeff Newmiller

[R] variable values in plotmath expressions

2012-03-15 Thread Richard M. Heiberger
## I would like help in using variable values in plotmath expressions ## in lattice x <- 1:10 y <- 1:10 pval <- .95 plot(y ~ x, ## works as I want in base graphics main=substitute(list(alpha * " = " * group("",list(p),"")), list(p=pval))) plot(y ~ x, ## doesn't work as intended: "pval" is d

[R] Re : ROC Analysis

2012-03-15 Thread Pascal Oettli
Hi Camille, Probably by adding these lines: fpf <- unlist(performance(pred,"fpr")@y.values) fnf <- unlist(performance(pred,"fnr")@y.values) pLhood <- tpf/fpf   # Positive Likelihood Ratio nLhood <- fnf/tnf   # Negative Likelihood Ratio par(mfrow=c(1,2)) plot(x, pLhood, t='l', xlab='Value', ylab

Re: [R] Get Details About Clusters

2012-03-15 Thread A J
> Date: Thu, 15 Mar 2012 14:00:46 -0700 > Subject: Re: [R] Get Details About Clusters > From: peter.langfel...@gmail.com > To: anxu...@hotmail.com > CC: r-help@r-project.org > > On Thu, Mar 15, 2012 at 1:48 PM, A J wrote: > > > > Hi everybody! > > Anybody knows how can I get detalied informati

Re: [R] handling missing values

2012-03-15 Thread R. Michael Weylandt
Here you go: library(mgcv) y.list <- list(y1=runif(10), y2 <- runif(10), y3 <- runif(10)) y.list <- list(y1=runif(20)) x1 <- 1:20 x2 <- c(11, 15, 17, 2, 18, 6, 7, NA, 12, 10,21, 25, 27, 12, 28, 16, 17, NA, 12, 10) y.gam <-lapply(y.list, function(y)gam(y~s(x1,x2, k=10), na.action = na.exclude)) y.f

Re: [R] Timer on a function

2012-03-15 Thread Bert Gunter
Bill et. al: 1. This is new to me. Thanks. 2. As I read the man page, this is not guaranteed to work if the model fitting function does not contain sufficient interrupts. Is that correct? -- Bert On Thu, Mar 15, 2012 at 4:14 PM, William Dunlap wrote: > There is a setTimeLimit function in base.

Re: [R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 7:51 PM, Adam Zeilinger wrote: > Hello, > > I am trying to construct two matrices, F and V, composed of partial > derivatives and then find the eigenvalues of F*Inverse(V).  I have the > following equations in ryacas notation: > >> library(Ryacas) >> FIh <- Expr("betah*Sh*I

[R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-15 Thread Adam Zeilinger
Hello, I am trying to construct two matrices, F and V, composed of partial derivatives and then find the eigenvalues of F*Inverse(V). I have the following equations in ryacas notation: > library(Ryacas) > FIh <- Expr("betah*Sh*Iv") > FIv <- Expr("betav*Sv*Ih") > VIh <- Expr("(muh + gamma)*Ih

[R] Bar graph with 2 Y axis

2012-03-15 Thread KAYIS Seyit Ali
Dear R users,   I need to draw a barplot with 2 Y axis. I have 3 days each of wich having 2 groups (and error bar for each of them). The height of the 3rd day is too tall compared to others. That's why I have to use a second Y axis for that. I am using  "barplot2" function of "gplots" library (t

[R] ggplot2: goem_smooth and suppress messages

2012-03-15 Thread tibaker
Hi When I run my script using ggplot and geom_smooth I get messages that I would like to suppress: p <- ggplot(dataSubset) p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line() p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7) The messages look like this: geom_smooth: method="auto"

Re: [R] handling missing values

2012-03-15 Thread Mintewab Bezabih
Dear Michael, Thanks. I tried it and I was not able to run it on the gam line (sorry my programming is not that great). Since I am ussing the fitted vallues for another program I actually want a blank value in place of the missing data. Many thanks in advance Regards Minti _

Re: [R] Apt-get

2012-03-15 Thread beltrand
To add to the above, as far as I know Cran's Ubuntu repository is only available for LTS ( Ubuntu 10.04 and soon 12.04, whenever they put the repository together) and if you are using non LTS's versions of Ubuntu Michael Rutter's ppa is definitely the way to go, it is very up to date. -- View thi

Re: [R] Generation of correlated variables

2012-03-15 Thread Ted Harding
On 15-Mar-2012 Filoche wrote: > Hi everyone. > > Based on a dependent variable (y), I'm trying to generate some > independent variables with a specified correlation. For this > there's no problems. > However, I would like that have all my "regressors" to be > orthogonal (i.e. no correlation among

Re: [R] Timer on a function

2012-03-15 Thread William Dunlap
There is a setTimeLimit function in base. It could be encapsulated into the following to limit the time spent on an expression: timeOut <- function (expr, ...) { on.exit(setTimeLimit()) setTimeLimit(...) expr } E.g., with the following slow way to compute Euler's phi f <- functio

Re: [R] Timer on a function

2012-03-15 Thread Ben Bolker
Ramiro Barrantes precisionbioassay.com> writes: > I have a program that consists of a loop fitting a function > over many models. Sometimes the fitting on a > particular model takes minutes to converge. Is there a way that > I can limit the amount of time that R spends > on a given model:

Re: [R] Timer on a function

2012-03-15 Thread Bert Gunter
On Thu, Mar 15, 2012 at 2:24 PM, Ramiro Barrantes wrote: >    Hello, > > I have a program that consists of a loop fitting a function over many models. >  Sometimes the fitting on a particular model takes minutes to converge.  Is > there a way that I can limit the amount of time that R spends on

Re: [R] subsetting by cell value with a list

2012-03-15 Thread David Winsemius
On Mar 15, 2012, at 4:38 PM, G See wrote: my.df <- data.frame(IDX=1:42, x=rnorm(1:42)) my.df[my.df$IDX %in% c(17, 42), ] IDX x 17 17 -0.5110095 42 42 -1.0686427 subset(my.df, IDX %in% c(17,42) ) (I find subset to give clearer code than: df[which(df$colname cond>) , ], plus it c

[R] summing "transfers"

2012-03-15 Thread Farley, Robert
I have a dataframe from an On-Board Survey with weights ("expwgt") and variables for up to 8 used lines: VEH1 through VEH8. The lines are labeled "MT-..1" through "MT-902". I want to know how many transfers there are between MT-802 and MT-901. That is, when one of them is VEHx and the other is

[R] Timer on a function

2012-03-15 Thread Ramiro Barrantes
Hello, I have a program that consists of a loop fitting a function over many models. Sometimes the fitting on a particular model takes minutes to converge. Is there a way that I can limit the amount of time that R spends on a given model: say if my line is: fittingFunction( func, model.1

Re: [R] Generation of correlated variables

2012-03-15 Thread Bert Gunter
Rui: Try reading it again. Orthogonal polynomials are generated (subject to the caveats regarding machine precision stated therein). Note, especially, the "raw" argument. Cheers, Bert On Thu, Mar 15, 2012 at 1:06 PM, Rui Barradas wrote: > Hello, again. > >> >> This is not really working. Here w

Re: [R] cannot load shared object /usr/lib/R/library/grDevices/libs//cairo.so

2012-03-15 Thread beltrand
I have figured it out. It turns out that it is not a R problem. libfontconfig.so.1 links to libfreetype, it happens that there are two sets of libfreetype files in my system, one from Ubuntu and another from xampp. When the php script is run to invoke R it uses the libfreetype files in /opt/lampp

Re: [R] Generation of correlated variables

2012-03-15 Thread Rui Barradas
Hello, again. > > This is not really working. Here what I have for the moment. > Right, I've read only half of the description line of function 'poly'. The other half states that "These are all orthogonal to the constant polynomial of degree 0." But not pairwise orthogonal. You can look for

Re: [R] Generation of correlated variables

2012-03-15 Thread Filoche
Thank you everyone for your precious advice. I'll take time to look at it and try to make it work. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Generation-of-correlated-variables-tp4475799p4476346.html Sent from the R help mailing list archive at Nabble.com.

[R] V-Optimal Histogram

2012-03-15 Thread aaron.talebi
Is there a way to make V-Optimal Histogram in R? Thanks, Aaron -- View this message in context: http://r.789695.n4.nabble.com/V-Optimal-Histogram-tp4476413p4476413.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] subset problem

2012-03-15 Thread Farley, Robert
Str() found the problem; there were 2 blanks at the end of the name. Why does this occur when I read in with trim.factor.names = TRUE ? > > OBDataSumm <- read.spss("P:/Data/OBSurveys/OBSurvey-2010-2011/Final Delivery, > Metro On-Board O-D > Survey/LAMTA_OD_WEIGHTED_DATA_SETS_012512/LA

Re: [R] subsetting by cell value with a list

2012-03-15 Thread Petr Savicky
On Thu, Mar 15, 2012 at 03:47:24PM -0500, G See wrote: > On second thought, I must not understand your question because your > code works fine for me. > > > my.df[ which(my.df$IDX == c(17, 42)), ] >IDX x > 17 17 -0.5110095 > 42 42 -1.0686427 Hi. This seems to work due to the fact

Re: [R] Get Details About Clusters

2012-03-15 Thread Peter Langfelder
On Thu, Mar 15, 2012 at 1:48 PM, A J wrote: > > Hi everybody! > Anybody knows how can I get detalied information about clusters after using > hclust? > The issue is that if I have some items in different clusters, I would like to > get the cluster where each item is placed. > Taking into account

[R] Get Details About Clusters

2012-03-15 Thread A J
Hi everybody! Anybody knows how can I get detalied information about clusters after using hclust? The issue is that if I have some items in different clusters, I would like to get the cluster where each item is placed. Taking into account that my data set is too large, it is not useful to have t

Re: [R] subsetting by cell value with a list

2012-03-15 Thread G See
On second thought, I must not understand your question because your code works fine for me. > my.df[ which(my.df$IDX == c(17, 42)), ] IDX x 17 17 -0.5110095 42 42 -1.0686427 > my.df[my.df$IDX == c(17, 42), ] IDX x 17 17 -0.5110095 42 42 -1.0686427 Can you provide samp

Re: [R] 64 bit version for linux and build huge matrix

2012-03-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rich Shepard > Sent: Thursday, March 15, 2012 1:19 PM > To: r-help > Subject: Re: [R] 64 bit version for linux and build huge matrix > > On Fri, 16 Mar 2012, Shengyun Peng wrote:

Re: [R] subsetting by cell value with a list

2012-03-15 Thread G See
> my.df <- data.frame(IDX=1:42, x=rnorm(1:42)) > my.df[my.df$IDX %in% c(17, 42), ] IDX x 17 17 -0.5110095 42 42 -1.0686427 Garrett On Thu, Mar 15, 2012 at 3:25 PM, Ed Siefker wrote: > I would like to subset by dataframe by matching all rows that have any value > from a list of valu

Re: [R] 64 bit version for linux and build huge matrix

2012-03-15 Thread Marc Schwartz
On Mar 15, 2012, at 3:19 PM, Rich Shepard wrote: > On Fri, 16 Mar 2012, Shengyun Peng wrote: > >> I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. >> But after compile, I don't know how to start 64 bit R, as there is only >> one R executable under bin folder, not alike

[R] subsetting by cell value with a list

2012-03-15 Thread Ed Siefker
I would like to subset by dataframe by matching all rows that have any value from a list of values. I can get it to work if I have exactly one value, I'm not sure how to do it with a list of values though. This works and gives me exactly one line: my.df[ which( mydf$IDX==17)), ] I would like to

Re: [R] 64 bit version for linux and build huge matrix

2012-03-15 Thread Steve Lianoglou
Hi, On Thu, Mar 15, 2012 at 4:02 PM, Shengyun Peng wrote: > Hello: > > > I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. > But after compile, I don't know how to start 64 bit R, as there is only one R > executable under bin folder, not alike windows version which have

Re: [R] 64 bit version for linux and build huge matrix

2012-03-15 Thread Rich Shepard
On Fri, 16 Mar 2012, Shengyun Peng wrote: I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. But after compile, I don't know how to start 64 bit R, as there is only one R executable under bin folder, not alike windows version which have two executables. If your system

[R] 64 bit version for linux and build huge matrix

2012-03-15 Thread Shengyun Peng
Hello: I downloaded R from http://cran.cnr.berkeley.edu/, with the linux version. But after compile, I don't know how to start 64 bit R, as there is only one R executable under bin folder, not alike windows version which have two executables. Other than that, I want to build a matrix 655

[R] JSS support

2012-03-15 Thread Jan de Leeuw
We received a generous gift to support the Journal of Statistical Software (www.jstatsoft.org) from the DC Area R Users Group. If you think the Journal is a worthy cause, then support it through the Statistics Computing Support Fund at https://giving.ucla.edu/Standard/NetDonate.aspx?SiteNum=107

Re: [R] Problems downloading file

2012-03-15 Thread ualfes
Hi Pete, I have got the same problem on Windows Vista, but I found a solution from the docu: setInternet2(use = TRUE) seems to be necessary before download.file to make R be able to use some special dll from internet explorer. Ulrich -- View this message in context: http://r.789695.n4.nabble.

Re: [R] Generation of correlated variables

2012-03-15 Thread Petr Savicky
On Thu, Mar 15, 2012 at 10:48:48AM -0700, Filoche wrote: > Hi everyone. > > Based on a dependent variable (y), I'm trying to generate some independent > variables with a specified correlation. For this there's no problems. > However, I would like that have all my "regressors" to be orthogonal (i.e

Re: [R] Importing multiple worksheets from one Excle/ csv file into R

2012-03-15 Thread R. Michael Weylandt
The line I gave you will read them in, store them in an object called a list (which is just a generic holding structure, like a struct in C or a list in Python) and, once it's got them all in one list, rbind the whole list together to make one "super"-data.frame. If you want to keep them separately

Re: [R] Generation of correlated variables

2012-03-15 Thread Filoche
Hi there. This is not really working. Here what I have for the moment. library(ecodist) x <- 1:100 y1 <- corgen(x=x, r=.85, epsilon=.01)$y y2 <- corgen(x=x, r=.5, epsilon=.01)$y y3 <- corgen(x=x, r=.25, epsilon=.01)$y a = poly(cbind(y1, y2, y3), degree=1) cor(a[,1], a[,2]) In that case, the c

Re: [R] handling missing values

2012-03-15 Thread R. Michael Weylandt
Try adding na.action = na.exclude to your call to gam. Michael On Thu, Mar 15, 2012 at 1:00 PM, Mintewab Bezabih wrote: > Dear R users, > > I have problems handling missing values. THe problem is that after running my > codes the result I get just skips the missing values. What I want is for th

Re: [R] Apt-get

2012-03-15 Thread Tyler Ritchie
Beltrand was also on the mark, suggesting you add Michael Rutter's ppa to your repository sources. In both cases (adding the CRAN Ubuntu repositories or Michael Rutter's ppa), an additional package repository is added to your system's packages. apt then checks that repository along with the other

Re: [R] Importing multiple worksheets from one Excle/ csv file into R

2012-03-15 Thread R. Michael Weylandt
I don't use xlsReadWrite, but I've found XLConnect rather handy for things like this: once you're going, you can just loop over all sheets like so: do.call("rbind", lapply(1:50, function(n) readWorksheet(wb, sheet = n, OtherArgumentsGoHere))) which will gather them all in a list (from lapply) and

[R] Importing multiple worksheets from one Excle/ csv file into R

2012-03-15 Thread HJ YAN
Dear R experts, I am trying to import some data from some Excle files into R. My Excle file contains about 50 sheets. One solution I can think about is to convert my Excle file into csv file first and then load data into R using 'read.csv'. But it seems to me that 'read.csv' only supports readin

Re: [R] Generation of correlated variables

2012-03-15 Thread Rui Barradas
Hello, > > However, I would like that have all my "regressors" to be orthogonal (i.e. > no correlation among them. > ?poly poly(cbind(x1, x2, x3), degree=1) Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/Generation-of-correlated-variables-tp44757

Re: [R] Ggplot barchart drops factor levels: how to show them with zero counts?

2012-03-15 Thread Bart6114
Thanks for the fast reply. I'm using ggplot2 (it was a typo in my code example). However, using exactly the same example as I mentioned before, it only shows the bars for cyl=6&8. How can the behaviour be different on differing machines? I just checked for updates and I have the latest ggplot2.

[R] survival - deviance of test set

2012-03-15 Thread Saturated Funk
Hello, I am performing cross-validation on a number of survival models fitted with the coxph function and would like to use the likelihood ratio test on the left-out cases as the criteria for comparison of PCA, SPCA, ridge, lasso, etc.  Is there an easy way to do this?  I think predict.coxph mi

[R] Generation of correlated variables

2012-03-15 Thread Filoche
Hi everyone. Based on a dependent variable (y), I'm trying to generate some independent variables with a specified correlation. For this there's no problems. However, I would like that have all my "regressors" to be orthogonal (i.e. no correlation among them. For example, y = x1 + x2 + x3 where

Re: [R] Accessing variable's name as an attribute?

2012-03-15 Thread Rui Barradas
Hello, > > What I want to do with each iteration of the loop I want to create another > uniquely named > groupedData object - I just don't know how to assign a unique variable > name. > The best way should be to create a list of groupedData objects. Along the lines of library(nlme) n <- 100

Re: [R] Extending a group of S4 classes by setClassUnion ?

2012-03-15 Thread Martin Morgan
On 03/15/2012 09:51 AM, Alexander wrote: Hi Martin, thanks for your quick answer. I didn't know that '.' could be missleading. Is there any standard way to name function for S4 objects? "get","set" etc..? Hi Alexander -- it's usually better to include the original email in the reply, to provid

Re: [R] Equation as a character string

2012-03-15 Thread Gabor Grothendieck
On Thu, Mar 15, 2012 at 12:58 PM, Rui Barradas wrote: > Hello, > >> >> Hi Emily, >> >> Yes (see below), but you might be better off by writing a simple >> function.  Here are examples both ways (usually eval parse is highly >> discouraged). >> >> Cheers, >> >> Josh >> > > Yes, eval/parse is discou

Re: [R] How to add grid lines at specific position to a plot?

2012-03-15 Thread Luke Miller
abline(h = 0) will do what you want. abline(h = c(0,1,2)) would draw additional lines at y = 1 and y = 2. abline(v = 0) would draw a vertical line at x = 0. All of these lines will be plotted on top of whatever you plotted previously, so you may have to replot your points or lines so that they're n

Re: [R] How to add grid lines at specific position to a plot?

2012-03-15 Thread Sarah Goslee
abline(h=0) On Thu, Mar 15, 2012 at 1:05 PM, Michael wrote: > How to add grid lines at specific position to a plot? > > Hi all, > > [Disclaimer: I have done extensive and intensive searching on Google and > asked around but couldn't find a solution to this problem. > Please help me instead of jus

Re: [R] Extending a group of S4 classes by setClassUnion ?

2012-03-15 Thread Alexander
Hi Martin, thanks for your quick answer. I didn't know that '.' could be missleading. Is there any standard way to name function for S4 objects? "get","set" etc..? I saw your example, and I was wondering, why get.par(ext) put out "Son1", and not the same as get.par(new("Son1", name="Son1", par=3))

[R] handling missing values

2012-03-15 Thread Mintewab Bezabih
Dear R users, I have problems handling missing values. THe problem is that after running my codes the result I get just skips the missing values. What I want is for the missing values to appear in my results as well. I have put a workable example below and as you could see the missing value in

Re: [R] Equation as a character string

2012-03-15 Thread Rui Barradas
Hello, > > Hi Emily, > > Yes (see below), but you might be better off by writing a simple > function. Here are examples both ways (usually eval parse is highly > discouraged). > > Cheers, > > Josh > Yes, eval/parse is discouraged but there's a way of using it, that is less troublesome, to c

[R] How to add grid lines at specific position to a plot?

2012-03-15 Thread Michael
How to add grid lines at specific position to a plot? Hi all, [Disclaimer: I have done extensive and intensive searching on Google and asked around but couldn't find a solution to this problem. Please help me instead of just pointing out how simple and stupid my question is. God bless good folks!

Re: [R] Apt-get

2012-03-15 Thread Sarah Goslee
Try this: Go to your favorite CRAN mirror. Click on "R Binaries" then "linux" then "ubuntu" and send the link with directions to install current ubuntu binaries to your IS people. Which, you'll note, is exactly what Jeff Newmiller suggested. Sarah On Thu, Mar 15, 2012 at 12:50 PM, Scott Raynaud

Re: [R] coloring wireframe plot with independent/separate matrix of color values.

2012-03-15 Thread ilai
On Wed, Mar 14, 2012 at 9:47 PM, Alex Miller wrote: > Dear R Users, > > I am trying to plot a matrix (a Digital Elevation Model) using wireframe > [lattice] and color that matrix based on a separate/independent matrix of > the same resolution This makes no sense. the values in DEM are the z-coord

Re: [R] Using the mantel test in Ape Package

2012-03-15 Thread Sarah Goslee
Hi Dorothea, I've copied the ape maintainer on this, because I believe you may have found a bug. Your analysis works without warning in ape 2.8, but gives warnings in the current ape_3.0.1. But what makes me think that this is a problem with the new version is that the example given in ?mantel.t

Re: [R] Apt-get

2012-03-15 Thread Scott Raynaud
My IS people insist that the latest version of R avaialble via apt-get is 2.13.1.  Anything later they claim will have to be compiled.  True? Will I have to compile every time I update R?  Seems like a lot of work. Surely there's a way around it. - Original Message - From: Jeff Newmiller

Re: [R] Extending a group of S4 classes by setClassUnion ?

2012-03-15 Thread Martin Morgan
Hi Alexander -- On 03/15/2012 07:57 AM, Alexander wrote: Hi, I would like to create some S4 classes as follows setClass("Father",representation(name="character")) setClass("Son1",contains="Father",representation(par="numeric")) setClass("Son2",contains="Father",representation(par="logical")) S

Re: [R] Using the mantel test in Ape Package

2012-03-15 Thread Dorothea Hill
Hi, okay thanks. I've attempted the commands you suggested (I have provided all of the dput results - I am not sure how to provide a "smaller" example). I hope this is ok. > sessionInfo() R version 2.14.2 (2012-02-29) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United

Re: [R] Ggplot barchart drops factor levels: how to show them with zero counts?

2012-03-15 Thread Sarah Goslee
One possibility: update to ggplot2. The original ggplot isn't even on CRAN any longer. When I tried your example with ggplot2, the empty bar for 4 was plotted as you'd expect. Thanks for the small reproducible example. Sarah On Thu, Mar 15, 2012 at 11:47 AM, Bart6114 wrote: > Hello, > > When p

Re: [R] Average row and column

2012-03-15 Thread MSousa
Thank you. Works perfectly -- View this message in context: http://r.789695.n4.nabble.com/Average-row-and-column-tp4474524p4475438.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.et

Re: [R] Adding mean values to boxplots

2012-03-15 Thread Cleland
Great. Thanks very much for that... and for pointing out the obvious error! Much appreciated. Tom -- View this message in context: http://r.789695.n4.nabble.com/Adding-mean-values-to-boxplots-tp4474700p4475472.html Sent from the R help mailing list archive at Nabble.com.

[R] Accessing variable's name as an attribute?

2012-03-15 Thread Rob Forsyth
Sorry - I suspect this is a very basic query. I have a data frame structured "flat" (i.e. separate observations for a given subject ID on separate lines). Using the nlme library I create a groupedData object suitable for further analysis thus: dataset <- groupedData(VARIABLE ~ TIME|ID, data=sfa

[R] Ggplot barchart drops factor levels: how to show them with zero counts?

2012-03-15 Thread Bart6114
Hello, When plotting a barchart with ggplot it drops the levels of the factor for which no counts are available. For example: library(ggplot) mtcars$cyl<-factor(mtcars$cyl) ggplot(mtcars[!mtcars$cyl==4,], aes(cyl))+geom_bar() levels(mtcars[!mtcars$cyl==4,]) This shows my problem. Because no cou

Re: [R] single, double or no quotes in expression

2012-03-15 Thread capy_bara
Many thanks, "parse" is exactly what I was looking for!! Hannes -- View this message in context: http://r.789695.n4.nabble.com/single-double-or-no-quotes-in-expression-tp4475247p4475475.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] single, double or no quotes in expression

2012-03-15 Thread David Winsemius
On Mar 15, 2012, at 10:55 AM, capy_bara wrote: Dear all, I am confused about how to create an expression. I use a package (rsbml) which uses expressions and seems to make a difference if there is a quote around the expression or not. For example, package works with expressions such as e

Re: [R] Adding mean values to boxplots

2012-03-15 Thread ilai
You want to assign your call to boxplot as an object that contains the plot information set.seed(1) b <- matrix(rgamma(100,(1:4)/2,.5),nc=4) (bxp <- boxplot(b)) Now you can use the info in bxp for placement, e.g.: text(1:length(bxp$names),bxp$stats[3,],round(bxp$stats[3,],2),pos=3) By the way,

Re: [R] single, double or no quotes in expression

2012-03-15 Thread Sarah Goslee
Hi, You don't provide a reproducible example, but I suspect what you need is parse(): > parse(text = "A + B") expression(A + B) Sarah On Thu, Mar 15, 2012 at 10:55 AM, capy_bara wrote: > Dear all, > > I am confused about how to create an expression. I use a package (rsbml) > which uses express

Re: [R] Using the mantel test in Ape Package

2012-03-15 Thread Sarah Goslee
Hi, You didn't copy the main r-help list on this email, so I've added them back it. Beyond that, I don't see anything grossly wrong. You don't provide enough information to reproduce the problem: mantel.test() works with the 7x7 parts you provided. So you'll need to provide a small reproducible

Re: [R] Moore-Penrose Generalized determinant?

2012-03-15 Thread Sean O'Riordain
My colleague asked me to thank those of you who responded. Kind regards, Sean -- View this message in context: http://r.789695.n4.nabble.com/Moore-Penrose-Generalized-determinant-tp4471629p4475415.html Sent from the R help mailing list archive at Nabble.com. ___

[R] Extending a group of S4 classes by setClassUnion ?

2012-03-15 Thread Alexander
Hi, I would like to create some S4 classes as follows setClass("Father",representation(name="character")) setClass("Son1",contains="Father",representation(par="numeric")) setClass("Son2",contains="Father",representation(par="logical")) Son1<-new("Son1") Son1@name<-"Son1" Son1@par<-3 Son2<-new("S

[R] single, double or no quotes in expression

2012-03-15 Thread capy_bara
Dear all, I am confused about how to create an expression. I use a package (rsbml) which uses expressions and seems to make a difference if there is a quote around the expression or not. For example, package works with expressions such as > expression(A + B) but not with > expression("A + B") I

Re: [R] how to hide code of any function

2012-03-15 Thread Duncan Murdoch
On 15/03/2012 8:53 AM, mrzung wrote: hi I'm making some program and it need to be hidden. it's not commercial purpose but it is educational, so i do want to hide the code of function. for example, if i made following function: a<-function(x){ y<-x^2 print(y) } i do not want someone to type

Re: [R] can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)

2012-03-15 Thread John Smith
Sorry. I am still using the 9-11 March 2011 version of course2.pdf. On Wed, Mar 14, 2012 at 5:52 PM, David Winsemius wrote: > > On Mar 14, 2012, at 4:09 PM, John Smith wrote: > > With most current version of R and RMS, the 4 curves are drew in >> 4 separate panels. Can anyone show me how can I

Re: [R] Average row and column

2012-03-15 Thread David Winsemius
On Mar 15, 2012, at 10:23 AM, MSousa wrote: Sorry, I ll explain better. For example in the next dataset, x<-data.frame(v_source=3,v_destine=3,dist=4) x<-rbind(x,data.frame(v_source=7,v_destine=7,dist=0)) x<-rbind(x,data.frame(v_source=6,v_destine=6,dist=0)) x<-rbind(x,data.frame(v_source=4

[R] How to change the number of axis?

2012-03-15 Thread qiao xue
Hi, I use R to plot a graph with 2 frames. Because the limit of pixel or others, the screen fail to show the graph. So I have to draw a point every 10 frames. So the total of x axis becomes 2000. So when imaging the picture, I still hope that the total of x-axis is 2. I need to find a way

Re: [R] Average row and column

2012-03-15 Thread MSousa
Sorry, I ll explain better. For example in the next dataset, x<-data.frame(v_source=3,v_destine=3,dist=4) x<-rbind(x,data.frame(v_source=7,v_destine=7,dist=0)) x<-rbind(x,data.frame(v_source=6,v_destine=6,dist=0)) x<-rbind(x,data.frame(v_source=4,v_destine=4,dist=56)) x<-rbind(x,data.frame(v

[R] how to hide code of any function

2012-03-15 Thread mrzung
hi I'm making some program and it need to be hidden. it's not commercial purpose but it is educational, so i do want to hide the code of function. for example, if i made following function: a<-function(x){ y<-x^2 print(y) } i do not want someone to type "a" and take the code of the function.

Re: [R] Problem reading a graph file

2012-03-15 Thread Marc Marí Dell'Olmo
I obtain this message: Error: C stack usage is too close to the limit Marc Marí-Dell'Olmo CIBER Epidemiología y Salud Pública Servei de Sistemes d'Informació Sanitària (SeSIS) Agència de Salut Pública de Barcelona Pl. Lesseps 1. 08023 Barcelona Tel. 93 2027775 | Fax. 93 3686943 www.aspb.cat

[R] A question about loglik in GLMM

2012-03-15 Thread Freddy Hernández
Hi All, I am using the glmer function to adjust a simple model (mod1) with Poisson response variable and random intercept. When I use logLik(mod1) I obtain a value different from if I calculate the log-likelihood using the pdf. Someone could explain if I have an error? This is the code for the

[R] Adding mean values to boxplots

2012-03-15 Thread Cleland
Hello there, I was wondering if anyone might be able to help me as I'm pretty new to R. I'm trying to create a boxplot from a data table returned from an sproc. I have the following code, which generates the plot as I'd like it: library("RODBC"); conn <- odbcConnect("datawarehouse"); # connect to

Re: [R] Average row and column

2012-03-15 Thread MSousa
Sorry, I ll explain better. For example in the next dataset, x<-data.frame(v_source=3,v_destine=3,dist=4) x<-rbind(x,data.frame(v_source=7,v_destine=7,dist=0)) x<-rbind(x,data.frame(v_source=6,v_destine=6,dist=0)) x<-rbind(x,data.frame(v_source=4,v_destine=4,dist=56)) x<-rbind(x,data.frame(v

Re: [R] ROC Analysis

2012-03-15 Thread Camille Leclerc
Hi, I made a mistake, effectively Pascal your method given to the first message is correct. I didn't use the good data, so it's sure that it could not work ! But, I have an another question : Can I obtain a same graph except that the y-axis represents the likelihood ratio ? All the best, Camill

[R] can anyone tell me what is the meaning of the x and y axis ?

2012-03-15 Thread Jie Tang
hi ,I am trying to using wavelet package. require(wavelets) wt <- dwt(aa, n.levels=4, boundary="reflection", fast=TRUE) plot(wt) and we can get the figure as the attachment. aa is a data array that came from the one day obvervation in 1HZ and has the length of 86400 . Can anyone tell me what i

[R] line plot over a barplot

2012-03-15 Thread anupam sinha
Dear all, I have data in the following format : X-axisY-axis <010% 0-20 20% 20-4030% 40-6040% . and so on. I want to plot a bar graph of the above. Also I would want to add a trendline passing either through the

Re: [R] Needing a better solution to a lookup problem.

2012-03-15 Thread Davis, Brian
Thanks for the point in the right direction. I now have a great solution. > library(GenomicRanges) > system.time({ + snplist<-with(snp, GRanges(CHR, IRanges(POS, POS))) + locations<-with(targets, GRanges(CHR, IRanges(START, STOP))) + olaps<-findOverlaps(snplist, locations) + }) user system el

Re: [R] Integrate inside function

2012-03-15 Thread David Winsemius
On Mar 15, 2012, at 6:08 AM, Mauro Rossi wrote: Dear R users, first I take this opportunity to greet all the R community for your continuous efforts. I wrote a function to calculate the pdf and cdf of a custom distribution (mixed gamma model). The function is the following: pmixedgamma

  1   2   >