[R] counts of each column that are not NA, and/or greater than column means

2008-02-03 Thread Ng Stanley
Hi, Given a test matrix, test <- matrix(c(1,2,3,NA,2,3,NA,NA,2), 3,3) A) How to compute the counts of each column (excluding the NA) i.e., 3, 2, 1 B) How to compute the counts of each column (excluding the NA) that are greater than the column means ? i.e., 1, 1, 0 I could write a for loop, but

[R] R class accessor problem in 2.6

2008-02-03 Thread Joseph Wang
I was able to track down the problem that causes R-Swig to fail in 2.6. In 2.5, I am able to use the set method against '$' and '$<-' to cause expressions like r$d to get dispatched to get and set functions. This no longer seems to work in 2.6, and I was wondering if anyone can give informatio

[R] distances between points in R^3

2008-02-03 Thread baptiste Auguié
Dear R helpers, I'm trying to write a numerical scheme for a boundary integral method to solve an electromagnetic problem. This requires the computation of the distance between points at the surface of an object (a sphere, in my example). Here is my code, > require(rgl) > r<-1 > size<-10 >

[R] Help with loops and how R stores data

2008-02-03 Thread R-novice
I am trying to make an array c(3,8) that contains the averages of what is in another array c(9,8). I want to average rows 1:3, 4:6, 7:9 and have a loop replace the generic 1:24 values in my array with the average of the three rows. The problem I am having is that R only replaces the last value

[R] need help

2008-02-03 Thread [EMAIL PROTECTED]
Good afternoon, I've installed R on Suse 10.3 compiling the source files. I opne the program on shell configuration and i have a problem saving the workspace and *.R or *.Rdata files. I 've read the manual and written the comand as it says but the output is: save.image() Errore in gzfile(file,

[R] New version 2.6.1- the menu is written in german

2008-02-03 Thread cris
Dear all, i have recently update R in my computer. To my surprise the menu bar is written in German language. This is the first time this happen to me, usually it is English the language used. I download the last version from several mirrors from different English and Spanish spoken countries

[R] use classificators learned in R in "real-life", e.g. C

2008-02-03 Thread sich
Hi there, I am interested in using R for machine learning (supervised classification). Currently, I have been investigating especially the rpart, tree, and randomForest package, and have achieved first results. are there any experiences, how the learned classificators could be used in e.g. C ? in

[R] png() and pdf() alignment problems

2008-02-03 Thread Jari Oksanen
Dear Roland Kaiser, I think there may different pixel-to-point scaling in different devices. This scaling seems not only to vary with the device but even with your physical screen. This is what happens with my current box (MacBook): > quartz() > par("mar")/par("mai") [1] 6 6 6 6 > par("c

Re: [R] how to get points from SpatialPolygonsDataFrame

2008-02-03 Thread Takatsugu Kobayashi
try tmp<- slot(ex_1.7.selected, 'polygons') sub.tmp <- slot(tmp[[1]],'Polygons') [EMAIL PROTECTED] will get you there. taka Jarek Jasiewicz wrote: > Milton Cezar Ribeiro wrote: > >> Dear all, >> >> I need to get all points for each polygons and save these points in a >> data.frame. I tryed

Re: [R] best text editor for Linux?

2008-02-03 Thread 宋时歌
Based on my own experience, the difficulty of installation is mainly Linux-specific (especially SuSE), should not be a problem on Windows platform. As computer hardware getting better each day, the resource problem associated with Java seems to be less and less relevant. My complain about JGR is th

Re: [R] best text editor for Linux?

2008-02-03 Thread Simon Blomberg
Many Linux/Unix users (including me) recommend running R in Emacs, using ESS http://ess.r-project.org/ . You can also run R through Emacs/ESS on Windows. Simon. On Mon, 2008-02-04 at 07:35 +0100, Jarek Jasiewicz wrote: > Wade Wall wrote: > > Hi all, > > > > I know this question has been asked in

Re: [R] how to get points from SpatialPolygonsDataFrame

2008-02-03 Thread Jarek Jasiewicz
Milton Cezar Ribeiro wrote: > Dear all, > > I need to get all points for each polygons and save these points in a > data.frame. I tryed to use the slot() function, but I can´t access the > "coords". > > grd <- GridTopology(c(1,1), c(1,1), c(10,10)) > polys <- as.SpatialPolygons.GridTopology(grd

Re: [R] best text editor for Linux?

2008-02-03 Thread Jarek Jasiewicz
Wade Wall wrote: > Hi all, > > I know this question has been asked in the past, but I am wondering if > anyone running R on Linux has any guidance as to a text editor that works > well with R. At the present time I am running R on Windows and using > TINN-R. For a number of reasons I want to swit

[R] Likelihood ratio test for competing risks regression

2008-02-03 Thread Brant Inman
R-helpers: I have a question regarding the crr function of the cmprsk package for performing competing risks regression. Specifically, I was wondering if the standard likelihood ratio test for a categorical covariate applies. For example: # Make up a fake

[R] how to get points from SpatialPolygonsDataFrame

2008-02-03 Thread Milton Cezar Ribeiro
Dear all, I need to get all points for each polygons and save these points in a data.frame. I tryed to use the slot() function, but I can´t access the "coords". grd <- GridTopology(c(1,1), c(1,1), c(10,10)) polys <- as.SpatialPolygons.GridTopology(grd) centroids <- coordinates(polys) x <- cen

Re: [R] Confidence Interval

2008-02-03 Thread Bill.Venables
Sorry, but the paper is wrong, or at least the language is very loose. It does speak about a 'confidence interval' for a statistic, but that makes no sense. The author apparently means a confidence interval for the parameter for which the statistic is an estimate, and nominates the profile likelih

Re: [R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
Yes, this is what I wanted and needed. Thank you all for your replies. Marcin On Feb 4, 2008 1:28 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > lattice has a type = "smooth" for this: > >library(lattice) >xyplot(dist ~ speed, cars, type = c("smooth", "p")) > > Or with a colored line

Re: [R] Confidence Interval

2008-02-03 Thread Jacques Wagnor
The motivation for the question comes from Figure 3 of this paper http://www.ma.hw.ac.uk/~mcneil/ftp/cad.pdf, which shows that a confidence interval for a statistic is possible. Does there exist a function in R for such a calculation? If not, how would one go about doing it in R? Any pointers wo

Re: [R] Drawing a loess line

2008-02-03 Thread Gabor Grothendieck
lattice has a type = "smooth" for this: library(lattice) xyplot(dist ~ speed, cars, type = c("smooth", "p")) Or with a colored line: xyplot(dist + dist ~ speed, cars, type = c("p", "smooth"), col = 1:2, distribute.type = TRUE) In ggplot2 its also a one linear: library(ggplot2) q

Re: [R] Drawing a loess line

2008-02-03 Thread Gavin Simpson
hits=-2.6 tests�YES_00 X-USF-Spam-Flag: NO On Sun, 2008-02-03 at 22:26 +0100, Marcin Kozak wrote: > Thanks a lot, it works. > > Any ideas what's going on here? > > y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, > 2.79, 2.54, 2.36, 2.65, > 2.69, 2.58, 3.27, 3.52, 2.93) > x

Re: [R] (Small) problem with barchart

2008-02-03 Thread G. Jay Kerns
Dear Kimmo, It doesn't appear that anyone has yet mentioned pareto.chart() in the qcc package; it may serve your purposes. Please note that it does not require the data frame to be ordered beforehand. x <- DATA[[2]] names(x) <- DATA[[1]] library(qcc) pareto.chart(x) Best wishes, Jay On Feb

Re: [R] Drawing a loess line

2008-02-03 Thread Henrique Dallazuanna
Try this: plot(x, y) points(x, predict(fit), pch=16, col="blue") On 03/02/2008, Marcin Kozak <[EMAIL PROTECTED]> wrote: > Thanks a lot, it works. > > Any ideas what's going on here? > > y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, > 2.79, 2.54, 2.36, 2.65, > 2.69, 2.58,

Re: [R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
Thanks a lot, it works. Any ideas what's going on here? y<-c(1.75, 1.41, 1.96, 1.03, 2.38, 2.19, 1.81, 1.91, 1.47, 2.25, 1.53, 2.79, 2.54, 2.36, 2.65, 2.69, 2.58, 3.27, 3.52, 2.93) x<-c(0.59, 0.49, 0.65, 0.41, 0.84, 0.87, 0.69, 0.72, 0.67, 0.93, 0.76, 1.04, 0.87, 0.92, 0.92, 1.04, 0.94, 1.15, 1.1

Re: [R] Drawing a loess line

2008-02-03 Thread Henrique Dallazuanna
Try this: cars.lo <- loess(dist ~ speed, cars) with(cars, plot(speed, dist)) lines(predict(cars.lo), col="blue") On 03/02/2008, Marcin Kozak <[EMAIL PROTECTED]> wrote: > Dear all, > > To draw a lowess line on a plot was a piece of cake; to draw a loess > line, however, seems not that easy. Is t

[R] Drawing a loess line

2008-02-03 Thread Marcin Kozak
Dear all, To draw a lowess line on a plot was a piece of cake; to draw a loess line, however, seems not that easy. Is the loess plotting implemented at all in relation to the loess function, or do I have to look in add-on packages? Thanks, Marcin __ R-

Re: [R] Saving a big table or matrix

2008-02-03 Thread Patrick Connolly
On Fri, 01-Feb-2008 at 03:23PM +0200, Atte Tenkanen wrote: |> I had a problem: |> |> I saved a matrix: |> |> > save(Tondistmatrix1, file="/Users/atte/Skriptit/Tondistmatrix1") |> |> then I tried to open it with R: |> > Tondistmatrix1=load("/Users/atte/Skriptit/Tondistmatrix1") |> > Tondistmatri

Re: [R] best text editor for Linux?

2008-02-03 Thread Adrian Dusa
On Saturday 02 February 2008, Frank E Harrell Jr wrote: > Stefan Grosse wrote: > [...] > > alternatively you could use the hardy (next ubuntu version) repository > > either via synaptic or the package (for the 0.4.9 package): > > > > http://packages.ubuntu.com/hardy/math/rkward > > The hardy releas

Re: [R] (Small) problem with barchart

2008-02-03 Thread Deepayan Sarkar
On 2/3/08, K. Elo <[EMAIL PROTECTED]> wrote: > Hi, > > I have a small problem when using barchart. I have the following data: > >letters a > 6f 18 > 1a 15 > 10 j 12 > 9i 12 > 4d 9 > 5e 6 > > The data is from a survey and summaries the alternative

[R] Chrooted R + Rserve

2008-02-03 Thread Peter Danenberg
I successfully chrooted R running Rserve with an unprivileged user, and thought I'd publish the process. Attached is a jailkit.ini for use with jailkit;* and a chroot/setuid wrapper, chwrap.c. To set up the chroot in, for instance, /var/R; perform: mkdir -v /var/R jk_init -v -c jailkit.ini

Re: [R] Mixed models

2008-02-03 Thread Douglas Bates
I believe that glmm.admb relies on the proprietary software ADMB. If so, your question is inappropriate for this list which is for discussion and assistance regarding the open source and freely available software R. There are ways of fitting a generalized linear mixed model in R, in particular th

[R] (Small) problem with barchart

2008-02-03 Thread Lauri Nikkinen
Perhaps, letters <- c("f","a", "j","i","d","e") a <- c(18,15,12,12,9,6) df <- data.frame(letters, a) library(lattice) barchart(reorder(df$letters, df$a) ~ df$a) -Lauri __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] Is it possible with two random effects in lme()?

2008-02-03 Thread Douglas Bates
On Feb 1, 2008 7:30 AM, Falco tinnunculus <[EMAIL PROTECTED]> wrote: > Dear all, > Is it possible with two random effects in lme()? > lmefit1<- lme(Handling ~ Mass + factor(Prey)+ Mass*factor(Prey), random = ~ > 1 |Place+Age) I assume that Place and Age are not nested. If so, it's possible to

[R] (Small) problem with barchart

2008-02-03 Thread K. Elo
Hi, I have a small problem when using barchart. I have the following data: letters a 6f 18 1a 15 10 j 12 9i 12 4d 9 5e 6 The data is from a survey and summaries the alternatives selected in one question. The idea is to have a bar chart illustr

[R] Effect size of comparison of two levels of a factor in multiple linear regression

2008-02-03 Thread Christoph Mathys
Dear R users, I have a linear model of the kind outcome ~ treatment + covariate where 'treatment' is a factor with three levels ("0", "1", and "2"), and the covariate is continuous. Treatments "1" and "2" both have regression coefficients significantly different from 0 when using treatment contr

[R] Sample code for interfacing with F90

2008-02-03 Thread max . e . brown
Hello List, I saw the example in "Writing R Extensions" where a convolve function is implemented in C, which is makes the whole business of calling C from R easy to understand. Is there a similar example of how to call Fortran 90 from R somewhere? Thanks, Max __

[R] polygon spanning tree

2008-02-03 Thread Milton Cezar Ribeiro
Dear all, I have a set of shapefiles which contents are polygons. I would like to know if is there a way of I obtain the links between the polygons, something like a "polygon spanning tree". For point patterns I can use de spatstat package, but I need to do it for polygons. Below I send a sampl

Re: [R] How to create following chart for visualizing multivariate time series

2008-02-03 Thread Johannes Hüsing
Megh Dal <[EMAIL PROTECTED]> [Sun, Feb 03, 2008 at 12:17:00PM CET]: > Can anyone here please tell me whether is it possible to > produce a chart displayed in http://www.datawolf.blogspot.com/ > in R for visualizing multivariate time series? If possible how? Assuming you mean http://bp0.blogger.

[R] How to create following chart for visualizing multivariate time series

2008-02-03 Thread Megh Dal
Hi all, Can anyone here please tell me whether is it possible to produce a chart displayed in http://www.datawolf.blogspot.com/ in R for visualizing multivariate time series? If possible how? Regards, - [[alternative HTML version deleted]] __

Re: [R] Reformatting data into data frame and plotting it in ggplot2

2008-02-03 Thread Tribo Laboy
Thanks Thierry It works perfect now. Regards, TL On Fri, Feb 1, 2008 at 11:28 PM, ONKELINX, Thierry <[EMAIL PROTECTED]> wrote: > Tribo > > That function was added during the latest update. So you should update > to this version (0.5.7). You can update packages with update.packages() > > > Th

Re: [R] [OT?] Question on bootstrapping

2008-02-03 Thread Matthias Gondan
(little correction below) > Dear list, > > This is off-topic, but perhaps there is an expert out there who can help > me in > a bootstrapping test. > > I have two samples A, B from, say, a normal distribution. A third sample R > is the vector of pairwise minima of the same random variables: > >