Re: [R] A plot similar to violin plot

2011-03-08 Thread Jim Lemon
On 03/08/2011 11:27 PM, C.H. wrote: Dear R Users, I would like to know is there any package to create a plot like this? http://dl.dropbox.com/u/5409929/cs1160521f01.gif X axis is categorical. And the positions of the points are corresponding to the frequency. (similar to violinplot) Hi CH, T

Re: [R] Any interim update for the basic packages distributed with R?

2011-03-08 Thread Prof Brian Ripley
This is what the R-patched and R-devel versions of R are for. Please see the R FAQ. Much of the base package is implemented by the compiled code in the R executable/DLL. update.packages() can only update packages on the selected repositories. The standard packages are never there. Updates

Re: [R] How to reference a package in academical paper

2011-03-08 Thread Jim Lemon
On 03/08/2011 11:35 PM, Uwe Ligges wrote: On 08.03.2011 13:15, Duncan Murdoch wrote: ... "meta$date" is in the source file (in inst/CITATION). You could change it to 2006 manually. ... Jim, please also correct your entry for the author field. Hi Uwe & Duncan, Thanks for your advice. Just t

Re: [R] lattice (panel.3dscatter): how to make plot symbol thicker?

2011-03-08 Thread Marius Hofert
Dear Peter, many thanks, this works perfectly :-) Indeed, it would be good to have this permanent. Cheers, Marius On 2011-03-09, at 03:27 , Peter Ehlers wrote: > On 2011-03-08 17:07, Jannis wrote: >> Searching the archive of the mailing list points to the following thread: >> >> https://sta

[R] Boxplot problem

2011-03-08 Thread Gaurav Kumar
Dear R-user, I'm facing problem to draw boxplot. I can draw my boxplot but the space option is not working for me. I've no clues where i'm doing wrong my data is as matrix as shown below:     [,1] [,2] [1,]   98  60 [2,]   96  70 [3,]   95  80 and i'm plotting as barplot(height=c(data[1,],

[R] Any interim update for the basic packages distributed with R?

2011-03-08 Thread jeanneyue
Hi, I notice that there are 12 basic packages distributed with R. I was told that the "base" package will not be updated because it comes a specific version of R even if I run update.packages(). Is it true? Will the rest of the basic packages be updated? Your help is greatly appreciate. Thx, Jea

[R] Venn Diagram corresponding to size in R

2011-03-08 Thread Shira Rockowitz
I was wondering if anyone could help me figure out how to make a Venn diagram in R where the circles are scaled to the size of each dataset. I have looked at the information for venn (in gplots) and vennDiagram (in limma) and I cannot seem to figure out what parameter to change. I have looked thi

Re: [R] lavaan diagram

2011-03-08 Thread William Revelle
Sebastian, At 7:03 PM -0800 3/8/11, Peter Ehlers wrote: On 2011-03-08 18:09, Sebastián Daza wrote: Hi everyone, I got the following error when I tried to diagram a confirmatory factor analysis using lavaan: lavaan.diagram(conf) Error in strwidth(xvars) : plot.new has not been called yet Does

Re: [R] A plot similar to violin plot

2011-03-08 Thread David Winsemius
On Mar 8, 2011, at 10:19 PM, David Winsemius wrote: On Mar 8, 2011, at 9:51 PM, Ista Zahn wrote: I'm afraid I still don't get it (see in line below). On Wed, Mar 9, 2011 at 1:49 AM, C.H. wrote: Sorry for being ambiguous. The data are some continuous variable (Y-axis) categorized into 3 g

Re: [R] A plot similar to violin plot

2011-03-08 Thread David Winsemius
On Mar 8, 2011, at 9:51 PM, Ista Zahn wrote: I'm afraid I still don't get it (see in line below). On Wed, Mar 9, 2011 at 1:49 AM, C.H. wrote: Sorry for being ambiguous. The data are some continuous variable (Y-axis) categorized into 3 groups (Controls, Depressed EF and Preserved EF, X-asis)

Re: [R] A plot similar to violin plot

2011-03-08 Thread Joshua Wiley
Hi CH, Its sounds like what you are trying to do is plot continuous Y values at categorical X values and rather than simply overplotting, spread out points that would overlap on the X axis. I have been working on implementing something like this in R based on an algorithm from Leland Wilkinson.

Re: [R] Date arithmetic coerces POSIXlt to POSIXct?

2011-03-08 Thread jdnew...@gmail.com
You should not be surprised at any result you obtain by adding an integer to a POSIXlt... that is like adding 5 to 3 meters... 5 whats? Start by using as.difftime to specify your time units on time intervals. As it happens, the default unit used by POSIXt types is seconds, and POSIXlt is not de

Re: [R] lavaan diagram

2011-03-08 Thread Peter Ehlers
On 2011-03-08 18:09, Sebastián Daza wrote: Hi everyone, I got the following error when I tried to diagram a confirmatory factor analysis using lavaan: lavaan.diagram(conf) Error in strwidth(xvars) : plot.new has not been called yet Does anyone have any idea about what is happening? Thank you in

Re: [R] A plot similar to violin plot

2011-03-08 Thread Ista Zahn
I'm afraid I still don't get it (see in line below). On Wed, Mar 9, 2011 at 1:49 AM, C.H. wrote: > Sorry for being ambiguous. > > The data are some continuous variable (Y-axis) categorized into 3 > groups (Controls, Depressed EF and Preserved EF, X-asis). OK. I'm having trouble way before this t

Re: [R] lattice (panel.3dscatter): how to make plot symbol thicker?

2011-03-08 Thread Peter Ehlers
On 2011-03-08 17:07, Jannis wrote: Searching the archive of the mailing list points to the following thread: https://stat.ethz.ch/pipermail/r-help/2009-March/193338.html Perhaps it helps you... On 03/08/2011 11:48 PM, Marius Hofert wrote: Dear expeRts, I would like to make a plot symbol in p

[R] lavaan diagram

2011-03-08 Thread Sebastián Daza
Hi everyone, I got the following error when I tried to diagram a confirmatory factor analysis using lavaan: lavaan.diagram(conf) Error in strwidth(xvars) : plot.new has not been called yet Does anyone have any idea about what is happening? Thank you in advance. -- Sebastián Daza sebastian.d..

[R] switch and factors

2011-03-08 Thread baptiste auguie
Dear list, Reading the help page for ?switch didn't give me more than a hint at what's going on here, x = 5 y = 2 foo <- function(a="x"){ switch(a, "x" = x, "y" = y) } foo(factor('x', levels=c('y', 'x'))) # 2 It seems that switch, when given a factor, uses the numeri

Re: [R] A plot similar to violin plot

2011-03-08 Thread C.H.
Sorry for being ambiguous. The data are some continuous variable (Y-axis) categorized into 3 groups (Controls, Depressed EF and Preserved EF, X-asis). The band of dots on the plot is the data point. The density of dots and the "fatness" of the band present the frequency of a particular value in Y

Re: [R] lattice (panel.3dscatter): how to make plot symbol thicker?

2011-03-08 Thread Jannis
Searching the archive of the mailing list points to the following thread: https://stat.ethz.ch/pipermail/r-help/2009-March/193338.html Perhaps it helps you... On 03/08/2011 11:48 PM, Marius Hofert wrote: Dear expeRts, I would like to make a plot symbol in panel.3dscatter thicker. As you can s

Re: [R] String manipulation

2011-03-08 Thread Jannis
Dennis, If I understand you correctly (your example does not point unambiguously to one unique solution...) you could try: dummy<- c('ac','ac','c','ac','ac','c') dummy.rle<-rle(dummy) result <- paste(dummy.rle$values,dummy.rle$lengths,collapse='_',sep='') You may need to remove the '1' in du

Re: [R] String manipulation

2011-03-08 Thread jim holtman
Try this: > x <- c('ac','ac','c','ac','ac','c') > rle(x) Run Length Encoding lengths: int [1:4] 2 1 2 1 values : chr [1:4] "ac" "c" "ac" "c" > z <- rle(x) > paste(z$values, ifelse(z$lengths == 1, '', z$lengths), collapse='_', sep = '') [1] "ac2_c_ac2_c" > On Tue, Mar 8, 2011 at 6:33 PM, Deni

[R] String manipulation

2011-03-08 Thread Denis Kazakiewicz
Dear [R] people Could you please help with following How to convert a vector 'ac','ac','c','ac','ac','c' into a single string 'ac2_c_ac2_c' Thank you in advance __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] ok to use glht() when interaction is NOT significant?

2011-03-08 Thread array chip
Thank you Andy for sharing your thoughts. John From: "Liaw, Andy" Cc: r-h...@stat.math.ethz.ch Sent: Tue, March 8, 2011 7:44:45 AM Subject: RE: [R] ok to use glht() when interaction is NOT significant? Just to add my ever depreciating $0.02 USD: Keep in min

[R] How to enforce location of installation of downloaded packages

2011-03-08 Thread Frank Harrell
Using R on Linux I want to force downloaded packages to go into /usr/local/lib/R/site-library. I have an .Rprofile file in my home directory containing the following: options(help_type='html', browser='chromium-browser', repos='http://www.ibiblio.org/pub/languages/R/CRAN', lib='/usr/local/lib/R/s

Re: [R] defining an array with one of the elements being a vector

2011-03-08 Thread Jannis
Cassie, why do you think that the code you want to run does not work? Running your code gives me an array with 6 dimensions and no errors. Do you use an old R version (I vaguely remember that something regarding arrays changed in R some time ago, i could be mistaken though...)? Do you want t

[R] lattice (panel.3dscatter): how to make plot symbol thicker?

2011-03-08 Thread Marius Hofert
Dear expeRts, I would like to make a plot symbol in panel.3dscatter thicker. As you can see from the minimal example below, the parameter "lwd" does not solve this problem. What can I do to make the plot symbol thicker? Cheers, Marius library(lattice) x <- 1:10 y <- x g <- expand.grid(x=x

Re: [R] consulta

2011-03-08 Thread John Sorkin
Yeleska, Has leyido los papeles de ayuda por rbind? Si no, abri R y entre ?rbind. Subset es mas deficil. Tiene que usar subscriptos. Por ejemplo, se tienes una matrix o data frame se llama datos, para ver la primera linea de datos entre datos[1,], par ver el segundo linea, datos[2,]. Se hay una col

Re: [R] consulta

2011-03-08 Thread Carlos Ortega
Hola Valeska, Tenemos una lista de R en español a la que te puedes suscribir: https://stat.ethz.ch/mailman/listinfo/r-help-es Seguro que en esta lista en español te podemos ayudar a clarificar las dudas que tienes. Aunque ya te adelanto que sería

[R] Date arithmetic coerces POSIXlt to POSIXct?

2011-03-08 Thread Buttrey, Samuel (Sam) (CIV)
Hi. This feels like a bug to me, or at least an undocumented feature, but I thought I'd see what people here thought of it. Consider a POSIXlt object like this one: > a <- as.POSIXlt ("2011-01-23 12:45:45") > class (a) [1] "POSIXlt" "POSIXt" Fine. Now, if I do some arithmetic on that obj

Re: [R] cv.lm syntax error

2011-03-08 Thread agent dunham
But I read in the forum that cv.lm is not for multiple regression, that's why i change it ti CVlm, however i fell to the same error u...@host.com -- View this message in context: http://r.789695.n4.nabble.com/cv-lm-syntax-error-tp3334889p3342333.html Sent from the R help mailing list archi

[R] minimum distance between line segments

2011-03-08 Thread Darcy Webber
Dear R helpers, I think that this may be a bit of a math question as the more I consider it, the harder it seems. I am trying to come up with a way to work out the minimum distance between line segments. For instance, consider 20 random line segments: x1 <- runif(20) y1 <- runif(20) x2 <- runif(2

[R] consulta

2011-03-08 Thread Valeska Yaitul
Hola soy novata en el programa R, pero lo encuentro súper interesante, tengo un par de consultas... 1. necesito crear una nueva base de datos. 2. necesito saber como se codifica el sample, subset y el rbind. Por favor agradecería sus respuesta Saludos Cordiales Valeska Yaitul Yaitul.

[R] defining an array with one of the elements being a vector

2011-03-08 Thread cassie jones
Dear all, I am trying to define an array as follows: a=array(NA,c(m,2,N,G)), Even though the numbers N and G are fixed, m is a vector. So, I can't define 'a' as above. For eg, N=3 G=6, but m=c(2,7,5) and length(m)=N. Can anyone suggest me how can I define 'a' when m is a vector? Thanks i

Re: [R] positions and margins differ between X11 and SVG device

2011-03-08 Thread Allan Engelhardt
Looks the same on my machine, albeit using svg() instead of CairoSVG - what version are you using? One sometimes useful technique is to create the first graphics in a vector format (pdf, svg) and then use an editing program like Inkscape or Illustrator to do any touch-up before publication, as

[R] goodness of fit test for 2-dimensional data in R

2011-03-08 Thread Entropi ntrp
Hi, I have a certain number of paired data that show errors at the x-axis and y-axis for the location of a target and is below. My aim is to fit a distribution to the uncertain location of the target via certain tests such as Chi-square test (if possible). I was wondering how it can be done in R. T

Re: [R] confusion matrix

2011-03-08 Thread Shi, Tao
Thanks, Richard, for your speedy reply! > >From: Richard M. Heiberger >To: "Shi, Tao" >Cc: r-help@r-project.org >Sent: Tue, March 8, 2011 12:28:05 PM >Subject: Re: [R] confusion matrix > > >You need to make your variables into factors and specify the levels. > >> x <- c(1,3,4,5) >> table(x) >

Re: [R] confusion matrix

2011-03-08 Thread Richard M. Heiberger
You need to make your variables into factors and specify the levels. > x <- c(1,3,4,5) > table(x) x 1 3 4 5 1 1 1 1 > factor(x) [1] 1 3 4 5 Levels: 1 3 4 5 > table(factor(x)) 1 3 4 5 1 1 1 1 > table(factor(x, levels=1:5)) 1 2 3 4 5 1 0 1 1 1 > Rich On Tue, Mar 8, 2011 at 3:22 PM, Shi, Tao wrote:

[R] confusion matrix

2011-03-08 Thread Shi, Tao
Hi list, Is there already a function somewhere to output the confusion matrix from two input vectors? "table" always automatically delete rows or columns with all 0's. For example, I would like the columns for "10" and "30" added back. Thanks! ...Tao 20 40 50 60 70 80 90 100 10

[R] defining a method for multiple classes

2011-03-08 Thread Robert M. Flight
Is it possible to define a method for multiple classes (that are not simply extensions of the other) without making separate setMethod() calls? As far as I understand it, this is how to currently set methods for multiple classes: setClass("myClass1", representation=representation(x="numeric",y="n

[R] ROC curves

2011-03-08 Thread Shun-Fu Chen
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Multiple testing corrections on very large vector

2011-03-08 Thread terdon
Hi Jorge, first of all THANKS! I just ran you suggestion and got blown away: system.time(res <- p.adjust(pv, method = 'fdr')) user system elapsed 55.052 3.100 62.560 I had tried the same thing using mt.rawp2adjp as per my original post, sent it to a cluster here on friday afternoo

Re: [R] Teaching R: To quote, or not to quote?

2011-03-08 Thread Yihui Xie
Oh, JSS... I was Achimitized last week... although I have been seeing library() calls without double quotes almost everywhere. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Tue, Mar 8, 2011

Re: [R] cv.lm syntax error

2011-03-08 Thread Don McKenzie
Your message subject says it all. The function is "cv.lm()". Also check the syntax for data.frame() On 8-Mar-11, at 8:47 AM, agent dunham wrote: Thanks for your answer, but I type the following: dfmod.1 <- data.frame(dat$v1,dat$v2,dat$v3,dat$v4, dat$v5,factor) CVlm(df= dfmod.1, form.l

Re: [R] lags for unbalanced panel data

2011-03-08 Thread Dieter Menne
Geoffrey Smith-3 wrote: > > Hello, I was wondering if there was an easy way to calculate the rate of > change in a variable for an unbalanced panel data set. Below is a > detailed > description in R of what I am asking. Thank you. Geoff > > A classic for mixed models, which simply does not

[R] positions and margins differ between X11 and SVG device

2011-03-08 Thread Frank Schwach
Hi, I'm trying to get a plot ready for publication, which involves getting it to look nice at a rather small size and to fine-tune positioning all the labels and sizes of the margins. I realise that I may not be doing this the right way and I welcome any comments about better approaches to do this

Re: [R] rShowMessage "Fatal error: unable to open the base package

2011-03-08 Thread Olga
ying zhang struq.com> writes: > > Hi All, > > As you may know I am trying connect R with java by RJava, now I run the > examples, I got this error > > rShowMessage "Fatal error: unable to open the base package > > I am using 64bits windows 7 and eclipse. Any suggestions? > > Many thanks >

Re: [R] ok to use glht() when interaction is NOT significant?

2011-03-08 Thread Bert Gunter
I basically agree -- an additional $.01 inline below. -- Bert On Tue, Mar 8, 2011 at 7:44 AM, Liaw, Andy wrote: > Just to add my ever depreciating $0.02 USD: > > Keep in mind that the significance testing paradigm puts a constraint on > false positive rate, and let false negative rate float.  Wha

Re: [R] cv.lm syntax error

2011-03-08 Thread agent dunham
Thanks for your answer, but I type the following: > dfmod.1 <- data.frame(dat$v1,dat$v2,dat$v3,dat$v4, dat$v5,factor) > CVlm(df= dfmod.1, form.lm = formula(dat$v1 ~ dat$v2+dat$v3+ dat$v4+ > dat$v5+ factor), m=3, seed=29, plotit=TRUE, printit =TRUE) Error en `[.data.frame`(df, , ynam) : undefin

Re: [R] How to plot multiple graphs?

2011-03-08 Thread Akshata Rao
Dear sir, Thanks a lot for your great help. The graph is amazing. However, considering the number of classes (Here for an example purpose I have taken only 3 and in reality I will be dealing with even 25 classes), will it be possible (a) to generate separate graphs for each of these classes? (b) H

Re: [R] lm - interaction factors - same number of items per level in factors?

2011-03-08 Thread Ista Zahn
Hi, You should avoid entering interaction terms without also including the lower-order terms involved in the interaction. Also, you are mixing variables from the workspace with those in (the data.frame?) df, which is a very bad idea. Try something like mod.lm <- lm(res ~ var1+ var2 + var3 + fact1*

Re: [R] If Statement

2011-03-08 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of dpender > Sent: Tuesday, March 08, 2011 4:07 AM > To: r-help@r-project.org > Subject: [R] If Statement > > Hi, > > I am having some problems using the if statement correctly.

[R] Fwd: Seeking guidance in package creation when it contains s4 class

2011-03-08 Thread Nipesh Bajaj
Any suggestion please how I can do this? Dear all, I am having problem to create a package when this package is supposed to have some newly created s4 class. Here is my workout: > #rm(list = ls()) > setClass("aClass", sealed=T,  representation(slot1 = "vector", slot2 = > "character")) [1] "aCla

Re: [R] Multiple testing corrections on very large vector

2011-03-08 Thread Jorge Ivan Velez
Hi terdon, You are absolutely right. I apologize for any inconvenience my lack of coffee might have caused :-) I simulated some p-values with the length of your vector and ran the p.adjust() function on them. Here is what I got: system.time(res <- p.adjust(pv, method = 'fdr')) user system el

Re: [R] How to plot multiple graphs?

2011-03-08 Thread Ista Zahn
Hi Akshata, This is really a mess, but I'll try to "guide you through" (see below). On Tue, Mar 8, 2011 at 7:40 AM, Akshata Rao wrote: > Dear R helpers, > > I have following data.frame giving asset class (i.e. bank, corporate, > sovereign etc. as there could be number of classes) and rating-wise

[R] lags for unbalanced panel data

2011-03-08 Thread Geoffrey Smith
Hello, I was wondering if there was an easy way to calculate the rate of change in a variable for an unbalanced panel data set. Below is a detailed description in R of what I am asking. Thank you. Geoff #Suppose I have the following unbalanced panel data; Person <- c(rep('Frank',5), rep('Tony'

Re: [R] lty=NULL crashing R for x11(type="cairo")

2011-03-08 Thread Stefan Th. Gries
Yes, and plotting a pvclust object also works on Windows. STG -- Stefan Th. Gries --- University of California, Santa Barbara http://www.linguistics.ucsb.edu/faculty/stgries --- On Tue, Mar 8, 2011 at 04:06,

Re: [R] R Commander QQ Plot with triangular distribution

2011-03-08 Thread John Fox
Dear R. Males, This isn't really an R Commander question, since the qqPlot() function is in the car package and is just invoked by the R Commander. >From ?qqPlot: "distribution: root name of comparison distribution - e.g., "norm" for the normal distribution ... Any distribution for which quantile

Re: [R] plotCI() with ggplot2

2011-03-08 Thread Scott Chamberlain
The code to use would be something like limits <- aes(ymax = y + se, ymin = y - se) # set error bar dimensions ggplot(yourdataframe, aes(x = x, y = y, colour = z)) + geom_point() + geom_errorbar(limits) On Tuesday, March 8, 2011 at 9:34 AM, Sascha Vieweg wrote: > Hello > > Currently, I plot

[R] NaNs in Nested Mixed Model

2011-03-08 Thread Johan Stenberg
Dear R users, I have a problem with something called "NaNs" in a nested mixed model. The background is that I have studied the number of insect nymphs emerging from replicated Willow genotypes in the field. I have 15 replicates each of 4 Willow genotypes belonging two 2 Willow species. Now I want

[R] R Commander QQ Plot with triangular distribution

2011-03-08 Thread Richard and Barbara Males
I am attempting to use the R Commander Graphs Quantile-Comparison functionality on a dataset, to compare with a triangular distribution. I have the package triangle. My question is on the syntax of how to specify the parameters of the theoretical distribution in the Parameters field of the dial

Re: [R] ok to use glht() when interaction is NOT significant?

2011-03-08 Thread Liaw, Andy
Just to add my ever depreciating $0.02 USD: Keep in mind that the significance testing paradigm puts a constraint on false positive rate, and let false negative rate float. What you should consider is whether that makes sense in your situation. All too often this is not carefully considered, and

Re: [R] Multiple testing corrections on very large vector

2011-03-08 Thread terdon
Hi Jorge, and thanks for your answer, it looks promising. However, I have a question. First of all, I am a lowly biologist so please excuse any horrible errors of understanding I may make. So, the BH correction depends on, among other things, sorting the vector of P-values from the smallest to th

[R] HoltWinters forecasting method

2011-03-08 Thread Michael Bach
Dear All, I was wondering why the forecast for an additive HoltWinters model is given by Yhat[t+h] = a[t] + h * b[t] + s[t + 1 + (h - 1) mod p]. I am a student and new to time series analysis and forecasting. That said, I considered t = 13 and h = 1: Yhat[13+1] = a[13] + b[13] + s[13 + 1] It see

Re: [R] Replacing values in a data.frame/matrix

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Thanks, that does the trick. I adjusted your code, such that it works with arbitrary matrices (i.e. not only matrices which use values from 1:length(perm): permutateValues <- function(x, perm=NULL) { values <- levels(as.factor(x)) names(perm) <- values if (is.null(perm)) { perm <- sample

Re: [R] plotCI() with ggplot2

2011-03-08 Thread ONKELINX, Thierry
Have a look at the examples of geom_errorbar() at the website: http://had.co.nz/ggplot2/geom_errorbar.html Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszo

[R] plotCI() with ggplot2

2011-03-08 Thread Sascha Vieweg
Hello Currently, I plot some coefficients with some intervals using function "plotCI()" (package "gplots") using the following code: (m1 <- matrix(0:5, nrow=2, byrow=T, dimnames=list(c("v1", "v2"), c("lo", "m", "hi" m2 <- m1 + 1 library(gplots) plotCI( x=1:length(m1[, 1]), pch="",

Re: [R] If Statement

2011-03-08 Thread Petr Savicky
On Tue, Mar 08, 2011 at 04:07:03AM -0800, dpender wrote: > Hi, > > I am having some problems using the if statement correctly. I have used it > many times previously so I dona't know what is different with this case. > Here is my problem: > > I have a 1X10 matrix of values as follows: > > > H.

Re: [R] assignment by value or reference

2011-03-08 Thread Matt Shotwell
On 03/08/2011 07:20 AM, Xiaobo Gu wrote: > On Wed, Sep 15, 2010 at 5:05 PM, Uwe Ligges > wrote: >> See the R Language Definition manual. Since R knows about lazy evaluation, >> it is sometimes neither by reference nor by value. >> If you want to think binary, then "by value" fits better than "by

Re: [R] Replacing values in a data.frame/matrix

2011-03-08 Thread Dimitris Rizopoulos
how about: m <- matrix(c(1,2,3,2,1,3,3,1,2), ncol = 3, byrow = TRUE) perm <- c(1, 3, 2) out <- perm[m] dim(out) <- dim(m) out I hope it helps. Best, Dimitris On 3/8/2011 4:05 PM, Thaler, Thorn, LAUSANNE, Applied Mathematics wrote: Hi all, Suppose we have the following matrix m<- matrix(c

Re: [R] A plot similar to violin plot

2011-03-08 Thread Ista Zahn
Hi, I don't understand what is being plotted here. Can you describe what you want in more detail? Best, Ista On Tue, Mar 8, 2011 at 7:27 AM, C.H. wrote: > Dear R Users, > > I would like to know is there any package to create a plot like this? > > http://dl.dropbox.com/u/5409929/cs1160521f01.gif

[R] Replacing values in a data.frame/matrix

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Hi all, Suppose we have the following matrix m <- matrix(c(1,2,3,2,1,3,3,1,2), ncol = 3, byrow=T) where in each row each number occurs only once. I'd like to define a permutation, e.g. 1 -> 2, 2 -> 1, 3 -> 3 and apply it to the matrix. Thus, the following matrix should result: m.perm <- matrix

Re: [R] Multiple testing corrections on very large vector

2011-03-08 Thread Jorge Ivan Velez
Hi terdon, Take a look at ?p.adjust and its argument n. For example, you could adjust B pv values by using p.adjust(pv[1:B], method = 'BH', n = B) Then, you can continue processing other subsets of pv and concatenate the result. Here, a for() loop might be useful. HTH, Jorge On Tue, Mar 8,

Re: [R] confint for glm (general linear model)

2011-03-08 Thread cossincos
it use normal dist. instead of T dist for Z statistic, which usually corresponds to asymptotic normal dist. > -0.283+c(-1,1)*qnorm(0.975)* 0.121 [1] -0.5201556 -0.0458444 -- View this message in context: http://r.789695.n4.nabble.com/confint-for-glm-general-linear-model-tp954071p3341527.html S

Re: [R] re-arranging data to create an image (or heatmap)

2011-03-08 Thread pierz
I have now advanced to image.plot from the "fields" package, which gives a nice color scalebar: image.plot(dat,col=imagecolsmat,xlab="time",ylab="abs") All that is left now is to change the scale on the x and y axis from 0 to 1 to the actual values. I do not understand why it does not read the pr

Re: [R] If Statement

2011-03-08 Thread David Winsemius
On Mar 8, 2011, at 7:07 AM, dpender wrote: Hi, I am having some problems using the if statement correctly. I have used it many times previously so I dona't know what is different with this case. Here is my problem: I have a 1X10 matrix of values as follows: H.MC [,1] [1,] 4.

Re: [R] Make R 'Beep'

2011-03-08 Thread Luke Miller
Including the \a escape sequence inside a cat() call should make a simple beep. > cat("All done! \a \n") On Tue, Mar 8, 2011 at 5:01 AM, Alaios wrote: > Dear all, > I would like to ask you if R can produce any kind of sound. It would be > useful when code execution stops R to notify me by playi

[R] Multiple testing corrections on very large vector

2011-03-08 Thread terdon
Hello all, I am calculating probabilities of association for terms in the GeneOntology database. I have ~4e7 probabilities and I would like to correct for multiple testing. At the moment I have something like the following: pv is a vector containing my 4e7 probabilities. To run the multipl

Re: [R] If Statement

2011-03-08 Thread andrija djurovic
Hi, matrix has a 2 dimensions. Is this work: a<-matrix(rep(c(1,2),c(5,5)),ncol=1) dim(a) for (i in 1:10) { ifelse(a[i,]==1, a[i,]<-runif(1,3,4.5), a[i,]) } a Andrija On Tue, Mar 8, 2011 at 1:07 PM, dpender wrote: > Hi, > > I am having some problems using the if statement correctly. I have u

[R] When using Rdonlp2 to do a MLE, I got some "system is exactly singular" error

2011-03-08 Thread Hsiao-nan Cheung
Hi, Recently I use Rdonlp2 to do a MLE of Markov-switching with TVTP, but during the optimization, there is always a "Error in solve.default(...) : Lapack routine dgesv: system is exactly singular" error, what's wrong? When searching on the web, someone said it is because the Hessian matrix, and c

Re: [R] SEM error

2011-03-08 Thread John Fox
Dear Kesinee, > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Kes > Sent: March-07-11 9:51 PM > To: r-help@r-project.org > Subject: [R] SEM error > > Dear All, > I am new for R and SEM. I try to fit the model with Y (ordinal o

Re: [R] assignment by value or reference

2011-03-08 Thread Xiaobo Gu
On Wed, Sep 15, 2010 at 5:05 PM, Uwe Ligges wrote: > See the R Language Definition manual. Since R knows about lazy evaluation, > it is sometimes neither by reference nor by value. > If you want to think binary, then "by value" fits better than "by > reference". Hi, Can we think it's eventually by

Re: [R] assignment by value or reference

2011-03-08 Thread Xiaobo Gu
On Wed, Sep 15, 2010 at 5:05 PM, Uwe Ligges wrote: > See the R Language Definition manual. Since R knows about lazy evaluation, > it is sometimes neither by reference nor by value. > If you want to think binary, then "by value" fits better than "by > reference". Hi, Can we think it's eventually by

[R] nlme: Computing REML likelihood value from ML likelihood value

2011-03-08 Thread CHAOUCH Aziz
Dear All, I have a question concerning the computation of the value of the Restricted Maximum Likelihood (REML) function evaluated at a given set of parameter estimates from the Maximum likelihood (ML) value. Following the book of Fitzmaurice, Laird and Ware (2004) "Applied Longitudinal Analysi

[R] If Statement

2011-03-08 Thread dpender
Hi, I am having some problems using the if statement correctly. I have used it many times previously so I dona't know what is different with this case. Here is my problem: I have a 1X10 matrix of values as follows: > H.MC [,1] [1,] 4.257669 [2,] 7.023242 [3,] 4.949857 [4,] 5.1070

Re: [R] This is supposed to predict a time series?!

2011-03-08 Thread Paul Hiemstra
On 03/08/2011 05:27 AM, Ben Simpkins wrote: > Hello, > > I just ran the predict.StructTS function using the AirPassengers data > and got a ridiculous result. Here's what I ended up with: > http://24.210.155.111/PredictWhat!.pdf > > Who wrote this? Am I seriously supposed to think this function woul

[R] lm - interaction factors - same number of items per level in factors?

2011-03-08 Thread agent dunham
Dear community, Apologies for my questions, I´m pretty newbie. The thing is, I was trying this lm: mod.lm <- lm(df$res ~ df$var1+ df$var2 + df$var3 +fact1:fact2) And factors are like this: > table(fact1) a b c 3 90 83 > table(fact2) a b c 4 87 85 Because of the interaction, i

Re: [R] allocating factor levels

2011-03-08 Thread David Winsemius
On Mar 7, 2011, at 10:13 PM, Darcy Webber wrote: Dear R users, I am working on allocating the rows within a dataframe into some factor levels.Consider the following dataframe: Start.action Start.time 1Start.setting2010-12-30 17:58:00 2

Re: [R] Teaching R: To quote, or not to quote?

2011-03-08 Thread Michael Friendly
On 3/7/2011 9:52 AM, Muenchen, Robert A (Bob) wrote: Hi All, When I teach an intro workshop on R, I've been minimizing "quote confusion" by always using quotes around package names in function calls. For example: install.packages("Hmisc") update.packages("Hmisc") library("Hmisc") citation("Hmi

Re: [R] problem in plot after calculating the derivative

2011-03-08 Thread David Winsemius
On Mar 8, 2011, at 12:39 AM, Hong Qin wrote: Here is a test code to calculate the derivative of a curve in sliding windows. I generated a linear example, and it should plot the derivative in a straight line. But, it does not?! Try adding ylim=c(0.1). You will get your straight line. I cons

[R] How to plot multiple graphs?

2011-03-08 Thread Akshata Rao
Dear R helpers, I have following data.frame giving asset class (i.e. bank, corporate, sovereign etc. as there could be number of classes) and rating-wise default frequency. I need to plot graphs for each of these classes i.e. bank, corporate and sovereign where I will be plotting ratings (AAA, AA

Re: [R] creating additional column

2011-03-08 Thread Philipp Pagel
Hi! max.col does what you want. Example: > dat <- data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20)) > dat a b c 1 1.17910304 -0.56951219 -0.2243664 2 -1.43840866 -0.99013855 -0.1613536 3 1.08515152 -0.77975274 0.3734530 4 -0.92154605 -0.20318367 0.1

Re: [R] More appropriate optimization routine?

2011-03-08 Thread Dimitri Liakhovitski
Thnaks a lot, Ben. I really like your suggestion about taking the the log. I'll definitely play with optim - since it seems to work very fast. Actually, I did take a look at the function - I created a grid of function results for many different values of a crossed with many different values of b. T

Re: [R] How to reference a package in academical paper

2011-03-08 Thread Uwe Ligges
On 08.03.2011 13:15, Duncan Murdoch wrote: On 11-03-08 1:20 AM, Jim Lemon wrote: On 03/08/2011 08:26 AM, Jorge Ivan Velez wrote: Hi Jan, R> citation('RODBC') Hi all, Upon reading this, I decided to check that this worked in the plotrix package. The first format is correct, but for some rea

Re: [R] beamer overlays with Sweave?

2011-03-08 Thread Duncan Murdoch
On 11-03-07 10:20 PM, Ben Bolker wrote: This may be asking too much, but I'm wondering if anyone has a solution (even a hack) for creating multiple (overlay) plots in an Sweave file and post-processing the overlays in beamer appropriately. For example, suppose I have a series of figure bl

Re: [R] Read data.frame from clipboard

2011-03-08 Thread Duncan Murdoch
On 11-03-08 6:16 AM, Prof Brian Ripley wrote: On Tue, 8 Mar 2011, Thaler,Thorn,LAUSANNE,Applied Mathematics wrote: Helas, it is Windows (Vista). I thought Excel was already a hint, but I reckon that Excel can run on Mac Os as well ;) It can, and I was writing that message on Mac OS X, where "

[R] A plot similar to violin plot

2011-03-08 Thread C.H.
Dear R Users, I would like to know is there any package to create a plot like this? http://dl.dropbox.com/u/5409929/cs1160521f01.gif X axis is categorical. And the positions of the points are corresponding to the frequency. (similar to violinplot) Thank you. Regards, CH -- CH Chan

[R] creating additional column

2011-03-08 Thread Bodnar Laszlo EB_HU
Hello everybody, I have a little problem in good old R. It is basically the following. I have this small database with 3 rows and the following columns: d1, d2, d3 and Highest d value - which selects the highest value from d1, d2, d3 in each row. d1 d2 d3 H

[R] Question about hdf5 package (was: (no subject))

2011-03-08 Thread Duncan Murdoch
On 11-03-08 4:47 AM, Stephen T. wrote: Hi, I am exporting an HDF5 file from Matlab (hdf5write function). It contains several datasets: one scalar, one vectory, one 2-D array, and one 3-D array. The hdf5read() function in the hdf5 library seems to load everything except the 3-D array. There ar

Re: [R] How to reference a package in academical paper

2011-03-08 Thread Duncan Murdoch
On 11-03-08 1:20 AM, Jim Lemon wrote: On 03/08/2011 08:26 AM, Jorge Ivan Velez wrote: Hi Jan, R> citation('RODBC') Hi all, Upon reading this, I decided to check that this worked in the plotrix package. The first format is correct, but for some reason the BibTeX format isn't: To cite packag

Re: [R] lty=NULL crashing R for x11(type="cairo")

2011-03-08 Thread Prof Brian Ripley
On Sat, 5 Mar 2011, Martin Maechler wrote: "IZ" == Ista Zahn on Sat, 5 Mar 2011 14:07:04 + writes: IZ> I confirm this bug exists and is 100% replicable on R IZ> version 2.12.2 (2011-02-25) Platform: i686-pc-linux-gnu IZ> (32-bit) WHoa... debugging ===> it *is* a bug in

  1   2   >