[R] Panel of pie charts

2008-07-29 Thread Amin Momin
Hi , I am looking to making a panel of pie charts fo some of my dritribution data . I was wondering if there is a way in any R package to write a small script to do so. Thanks, Amin [[alternative HTML version deleted]] __ R-help@r-proj

Re: [R] Bug in sd() and var() in handling vectors of NA (R version 2.7.1)?

2008-07-29 Thread Prof Brian Ripley
There was a bug in 2.6.1 which has since been corrected: there is no need to report corrected bugs in obsolete versions. Two different ways to compute the sd of a zero-length vector gave different answers. This is covered by the following NEWS item for 2.7.0 (version from R-patched) o

Re: [R] FW: Installing BRugs

2008-07-29 Thread Prof Brian Ripley
On Tue, 29 Jul 2008, BXC (Bendix Carstensen) wrote: A funny thing happened when I wanted a student of mine to install Brugs. Using the InstallPackages in the windows version, firts gives an erro, but trying again works flawlessly. There was a problem with the http connection. It happens

Re: [R] 'for' loop, two variables

2008-07-29 Thread Benno Pütz
On 29.Jul.2008, at 14:13, ONKELINX, Thierry wrote: Dear Frederike, #Both your functions are vectorized. So you don't need loops. Working with vectorized functions is much faster than looping. fn <- function (x,y) { ifelse(x>46 & x<52 & y<12, 1, 0) } datagrid <- expand.grid(i = 40:60, j = 0

Re: [R] 'for' loop, two variables

2008-07-29 Thread ONKELINX, Thierry
Dear Frederike, #Both your functions are vectorized. So you don't need loops. Working with vectorized functions is much faster than looping. fn <- function (x) { ifelse(x>46 & x<52, 1, 0) } res <- fn(40:60) fn <- function (x,y) { ifelse(x>46 & x<52 & y<12, 1, 0) } datagrid <- exp

Re: [R] 'for' loop, two variables

2008-07-29 Thread Duncan Murdoch
On 7/29/2008 7:55 AM, Oehler, Friderike (AGPP) wrote: Dear Rusers, I am still an unexperienced builder of functions and loops, so my question is very basic: Is it possible to introduce a second variable (j) into my loop. To examplify: # This works fine: fn <- function (x) {if (x>46 & x<52) 1 els

Re: [R] Is there way to multiple plots on gap.plot?

2008-07-29 Thread Jim Lemon
Hi Art, Ignore the last email, I realized that I had already written the "add" bit and it will be in plotrix 2.4-5. As far as I can see, both the "type" and "xlim" problems are solved. Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] 'for' loop, two variables

2008-07-29 Thread Oehler, Friderike (AGPP)
Dear Rusers, I am still an unexperienced builder of functions and loops, so my question is very basic: Is it possible to introduce a second variable (j) into my loop. To examplify: # This works fine: fn <- function (x) {if (x>46 & x<52) 1 else 0} res <-NULL for (i in 40:60) res <-c(res,fn(i))

[R] optim fails when using arima

2008-07-29 Thread MAIDER MATEOS DEL PINO
Hi all, I´m using the arima() function to study a time series but it gives me the following error: Error en optim(init[mask], armafn, method = "BFGS", hessian = TRUE, control = optim.control, : non-finite finite-difference value [3] I know that I can change the method of the arima() t

[R] stringdot ?

2008-07-29 Thread renata.camargo05
Dear all, I am using kernlab package in R, and I have amino acid sequences with different lenghts as input for a SVM and I need to go through this sequences using windows (sliding or fixed) of size X. Does anyone has any suggestions about which function I should use? I thought I could use strin

Re: [R] product of successive rows

2008-07-29 Thread Jorge Ivan Velez
Hi rcoder, Assuming that the number of rows of your matrix x is even, try also: x <- matrix(1:72,12) apply(x,2, tapply, rep(1:(nrow(x)/2),each=2),prod) # or using a function which argument "x" is your matrix prod.mat=function(x) { k=nrow(x) g=rep(1:(k/2),each=2) apply(x,2, tapply, g,prod) } pr

[R] mac install no font found problem in quartz display

2008-07-29 Thread Zhesi He
Dear list, I was attempted to install 2.7.1 in my mac only recently because of the fantastic quartz display support. I had no problem in building from source. But after installation, I always got font warnings as following when using quartz: Warning messages: 1: In axis(side = side, at = a

Re: [R] FW: Installing BRugs

2008-07-29 Thread Uwe Ligges
BXC (Bendix Carstensen) wrote: A funny thing happened when I wanted a student of mine to install Brugs. Using the InstallPackages in the windows version, firts gives an erro, but trying again works flawlessly. R version is 2.7.0 on WinXP. Any explanation? No, particularly if it worked the

[R] max

2008-07-29 Thread Paul Adams
Hello everyone, I have a vector of p-values and I am trying to find the max for the vector and add it to a list.I am using a loop to loop through 50 times.I have used the following code but it does not pick out the max and add to the list.Any help would be appreciated.   w<-c(v[[1]][3],v[[2]][3]

Re: [R] Problem reading a particular file with read.spss()

2008-07-29 Thread Prof Brian Ripley
It works for me, on Windows with that version of foreign. I also tried under Linux with valgrind, and nothing untoward was reported. The warnings are Warning messages: 1: In read.spss("mySPSSfile.sav") : mySPSSfile.sav: File-indicated character representation code (1252) looks like a Windo

[R] FW: Installing BRugs

2008-07-29 Thread BXC (Bendix Carstensen)
A funny thing happened when I wanted a student of mine to install Brugs. Using the InstallPackages in the windows version, firts gives an erro, but trying again works flawlessly. R version is 2.7.0 on WinXP. Any explanation? Bendix Carstensen __ Bend

[R] Bug in sd() and var() in handling vectors of NA (R version 2.7.1)?

2008-07-29 Thread Marisa Laetitia
In the previous versions of R (2.6.1), when a vector of NA was given to the functions 'sd' or 'var' with parameter na.rm = TRUE, it used to return NA. Now (2.7.1) it returns an ERROR : Example in 2.6.1: > sd(c(NA, NA, NA, NA), na.rm = TRUE) [1] NA Example in 2.7.1: > sd(c(NA, NA, NA,

Re: [R] list

2008-07-29 Thread jim holtman
Is this what you are after: this comes from the example of wilcox.test and shows the structure and how to reference the p-value: > z <- wilcox.test(x, y, paired = TRUE, alternative = "greater") > str(z) List of 7 $ statistic : Named num 40 ..- attr(*, "names")= chr "V" $ parameter : NULL $

[R] keywords

2008-07-29 Thread Edna Bell
Hi R Gurus! When you build a package, you need to put in keywords in the Rd files. Where would you find the list of keywords, please? TIA, Edna Bell __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the p

Re: [R] Is there way to multiple plots on gap.plot?

2008-07-29 Thread Jim Lemon
On Mon, 2008-07-28 at 12:15 -0700, Arthur Roberts wrote: > Hi, all, > > Does anyone now of a way to put multiple plots on gap.plot? > > Much appreciated, Hi Art, You must have read my mind. In solving the problem you had with gap.plot, I considered including an "add" argument that would allow th

[R] Problem reading a particular file with read.spss()

2008-07-29 Thread Chuck Cleland
Hi All: I have a seemingly typical SPSS data file with 219 rows and 486 variables. When I attempt to read this file into R with read.spss() in the foreign package, I consistently get a "crash". This is the sequence of events: > library(foreign) > sessionInfo() R version 2.7.1 Patched (200

Re: [R] how to add notes to the graph?

2008-07-29 Thread Jim Lemon
On Mon, 2008-07-28 at 06:32 -0700, rlearner309 wrote: > Hi, > I have a simple graph: > x <- c(1,2,3) > plot(x, pch=16,type="b") > > I would like to add some notes just beside these 3 dots, and the notes are > stored in a vector: > > a <- c(12,54,84) > > So the result will be: there should be

Re: [R] Help interpreting density().

2008-07-29 Thread Mark Difford
Hi Kevin, Clicking on the link I sent gets me there (?), though things are pretty slow at the moment. Perhaps try this related link, and from it get back to the first one: http://en.wikipedia.org/wiki/Density_estimation You can also get to this via histogram, so search for that in Wiki, and the

Re: [R] Help interpreting density().

2008-07-29 Thread rkevinburton
Sorry I tried WikiPedia and only found: Wikipedia does not have an article with this exact name. I will try to find some other sources of information. Kevin Mark Difford <[EMAIL PROTECTED]> wrote: > Hi Kevin, >> I still have my original question. How does the output relate to >> estimat

Re: [R] Help interpreting density().

2008-07-29 Thread Mark Difford
Hi Kevin, >> I still have my original question. How does the output relate to >> estimating the parameters >> of a given density? I read that for a gausian kernal: This isn't the place for such questions: you need to do some _basic_ reading on the subject so that you begin to understand somethi

Re: [R] Help interpreting density().

2008-07-29 Thread rkevinburton
Sorry, poor example. I started with normal deviates and jumped without thinking to Poisson. The main crux of the question is how does the output of density relate to the parameters that describe some of the standard distributions (mean and std for normal, lambda for Poisson, n and p for Binomial

Re: [R] Help interpreting density().

2008-07-29 Thread rkevinburton
OK. Thank you for pointing out my mistake. I still have my original question. How does the output relate to estimating the parameters of a given density? I read that for a gausian kernal: bw.nrd0 implements a rule-of-thumb for choosing the bandwidth of a Gaussian kernel density estimator. It de

Re: [R] product of successive rows

2008-07-29 Thread Moshe Olshansky
Assuming that the number of rows is even and that your matrix is A, element-wise product of pairs of rows can be calculated as A[seq(1,nrow(A),by=2),]*A{seq(2,nrow(A),by=2),] --- On Mon, 28/7/08, rcoder <[EMAIL PROTECTED]> wrote: > From: rcoder <[EMAIL PROTECTED]> > Subject: [R] product of su

[R] How to set the parameters in Trellis Graphics (by Lattice package)

2008-07-29 Thread G.H. Zuo
Dear R users I plot the trellis graphics by using the lattice package. Everything is OK. Now, I want set some parameters of the trellis graphics. 1. The tick label site. By default, only two tick labels had been output in x-axis of my plot. I want output four or five tick labels. In the tradi

<    1   2