Re: [R] help with simple 3d graph

2005-12-08 Thread Uwe Ligges
Frank Johannes wrote: > I have a large matrix and want to create a 3d surface of it. > Suppose the matrix looks something like Matrix K: > a<-c(1:1200) > b<-c(rep(1:30,40)) > c<-c(a+b^2) > K<-data.frame(a,b,c) > The vector values are not ordered (and repeat themselves as in

Re: [R] O-ring statistic

2005-12-08 Thread Rainer M Krug
Thanks a lot for your reply I'll look into that and let you know if I have further questions Rainer Adrian Baddeley wrote: > Rainer M Krug writes: > > > Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004. > > Rings, circles and null-models for point pattern analysis in ec

Re: [R] complex table

2005-12-08 Thread Jacques VESLOT
it is not perfectly clear for me, but you could try : DF[,1:72] <- as.data.frame(lapply(DF[,1:72], factor, levels=1:6)) lapply(split(DF, DF$cluster), function(x) apply(x[,-73], 2, table)) lapply(split(DF, DF$cluster), function(x) { x11() ; barplot(apply(x[,-73], 2, table)) }) lapply(split(DF, DF

Re: [R] Warnings about user error (was read.table error)

2005-12-08 Thread Eric C. Jennings
Prof. Pipley First let me thank you for your help. Second, you are correct, I should not have used the word error in my subject line. Regarding the lack of detach(), I simply forgot to include that in my email. The warnings regarding the incomplete final line do not seem to want to go away. The

Re: [R] about comparison of KURTOSIS in package: moments and fBasics

2005-12-08 Thread Spencer Graves
There are doubtless tests for kurtosos by itself, though I'm not familiar with any. When I'm conderned about kurtosis (which is often), I routinely make normal probability plots of observations and residuals from model fits. If I see roughly a straight line, I conclude that I won't

[R] help with simple 3d graph

2005-12-08 Thread Frank Johannes
I have a large matrix and want to create a 3d surface of it. Suppose the matrix looks something like Matrix K: a<-c(1:1200) b<-c(rep(1:30,40)) c<-c(a+b^2) K<-data.frame(a,b,c) The vector values are not ordered (and repeat themselves as in b). Whenever I try commands like

[R] R-help: gls with correlation=corARMA

2005-12-08 Thread gaffigan
Dear Madams/Sirs, Hello. I am using the gls function to specify an arma correlation during estimation in my model. The parameter values which I am sending the corARMA function are from a previous fit using arima. I have had some success with the method, however in other cases I get the follo

[R] O-ring statistic

2005-12-08 Thread Adrian Baddeley
Rainer M Krug writes: > Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004. > Rings, circles and null-models for point pattern analysis in ecology. > Oikos 104: 209-229 a statistic he called O-Ring statistic which is > similar to Ripley's K, only that it uses rings instea

Re: [R] Help

2005-12-08 Thread Spencer Graves
How do you propose to forecast? If it were me, I'd first worry about what to use to model, then the forecasting. I'd start with normal probability plots to make sure I didn't have any outliers, need a transformation, etc. If all looked plausibly normally distributed, I might first

Re: [R] logistic regression with constrained coefficients?

2005-12-08 Thread Prof Brian Ripley
On Fri, 9 Dec 2005, Richard A. O'Keefe wrote: > I am trying to automatically construct a distance function from > a training set in order to use it to cluster another data set. > The variables are nominal. One variable is a "class" variable > having two values; it is kept separate from the others

Re: [R] Constraint on coefficient when fitting with lm, glm etc ...

2005-12-08 Thread Prof Brian Ripley
I've just answered a similar question from Richard O'Keefe. MASS p.445 shows you how to do this for logistic regression, and the example is easy to modify. On Thu, 8 Dec 2005, Devred, Emmanuel wrote: > Dear R-users, > > I would like to know if there is any way to constraints optimized parameter

[R] logistic regression with constrained coefficients?

2005-12-08 Thread Richard A. O'Keefe
I am trying to automatically construct a distance function from a training set in order to use it to cluster another data set. The variables are nominal. One variable is a "class" variable having two values; it is kept separate from the others. I have a method which constructs a distance matrix f

Re: [R] reg peak detection

2005-12-08 Thread Jim Porzak
Ram, See excelent thread here last month. Search for "finding peaks" On 12/8/05, SHRIRAM R SAMPAT <[EMAIL PROTECTED]> wrote: > > Hallo everybody, > > I am doing a thesis in video extensometry and one my > approaches requires peak detection in a two > dimensional data. > > If would be grateful if a

[R] Assessing fit for non-nested models using clogit in survival package

2005-12-08 Thread Tomas Aragon
I am analyzing a 1-to-2 matched case-control study using clogit in the survival package. I am interested in comparing and assessing fit of non-nested models. I don't want to program all the diagnostics described in Hosmer/Lemeshow (2000). Can someone proficient with clogit and assessing fit for non

Re: [R] Loading namespaces

2005-12-08 Thread Matthias Kohl
BBK schrieb: >Just noticed the mssing ) at the end of the setClass statement, it is there >in the orginal > >Phineas > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of BBK >Sent: Thursday, December 08, 2005 8:18 PM >To: 'R-Help >Subject: [R] Loading namespa

[R] Genetic Algorithms with rbga.bin using AIC as the evalFunc

2005-12-08 Thread Bob Farmer
Hi all. I would like to use the rbga.bin function (from the "genalg" package) as part of a model selection process to whittle down a list of ~40 potential explanatory variables to only the most important ones. Unfortunately, despite my working knowledge of R for linear modeling and basic statis

Re: [R] operations on a list

2005-12-08 Thread szhan
Hello, Everyone, I am sorry that my message got truncated due to wrong format. I hope it works now: Hello, R Users, I have a list (say listexp) of 10,000 elements, each of which consists of a matrix (5X6). It likes: $"a" trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2 [1,]

Re: [R] Operations on a list

2005-12-08 Thread szhan
Hello, Everyone, I am sorry that my message got truncated. I resend it again as below: Hello, R Users, I have a list (say listexp) of 10,000 elements, each of which consists of a matrix (5X6). It likes: $"a" trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2 [1,] 5054

[R] complex table

2005-12-08 Thread Michael Anyadike-Danes
I have a data table with 712 cases (rows) describing young people’s activities for 72 months each case has been classified into one of 5 clusters. The first 72 columns are monthly activities coded 1 to 6 (e.g. school =1) and the 73rd column is the cluster number of the case. I wish to summari

Re: [R] Loading namespaces

2005-12-08 Thread BBK
Just noticed the mssing ) at the end of the setClass statement, it is there in the orginal Phineas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of BBK Sent: Thursday, December 08, 2005 8:18 PM To: 'R-Help Subject: [R] Loading namespaces I'm creating a pack

[R] operation on a list

2005-12-08 Thread szhan
Hello, R Users, I have a list (say listexp) of 10,000 elements, each of which consists of a matrix (5X6). It likes: $"a" trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2 [1,] 5054 98 8940 45 [2,] 6065 76 7

[R] qr with missing dependent variables

2005-12-08 Thread Richard Mott
Dear R-help We have a regression problem which could be solved elegantly if we could figure out how to get the R residuals() function to accept missing dependent variables. We have ~2 gene-expression vectors y, each being measured on the same set of individuals, but each having a small ran

[R] Loading namespaces

2005-12-08 Thread BBK
I'm creating a package for my own use that uses some S4 classes but no methods. I have a file called NAMESPACE it contains the line: exportClasses("foo") and at the top of the R file I have setClass("foo", representation(x="numeric") and the line: .onLoad<-function(libname,pkgname) When I ru

[R] Constraint on coefficient when fitting with lm, glm etc ...

2005-12-08 Thread Devred, Emmanuel
Dear R-users, I would like to know if there is any way to constraints optimized parameters using the function lm, glm or others that are written in the form: Lm( formula, data ...) As I understand, formula are of the type y ~ X1 +X2+ ... Xi (where Y, X1, X2 ..Xi are vectors). In my case I would li

Re: [R] Finding all possible partitions of N units into k classe

2005-12-08 Thread Tuszynski, Jaroslaw W.
See Also http://finzi.psych.upenn.edu/R/library/caTools/html/combs.html Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 11:19 AM To: Ales Ziberna Cc: R-help Subject: Re: [R] Finding all possible partitions of N units

Re: [R] Commented version of the home page graphics code

2005-12-08 Thread Romain Francois
Le 08.12.2005 18:37, Satsangi, Vivek a écrit : >Folks, > I was drawn to R, like many others, partly for the opportunity >to draw nice, colorful graphs (occasionally ones with meaning, too :-) >). I am still quite a newbie to R. >As such, I have been trying to understand the code for the grap

Re: [R] Help on a matrix task

2005-12-08 Thread Adrian DUSA
On Tuesday 06 December 2005 14:41, JeeBee wrote: > [...] > N = 4 > > input_numbers = seq((2^N)-1, 0, -1) > # convert to binary matrix > input_mat = NULL > for(i in seq(N-1,0,-1)) { > new_col = input_numbers %% 2 > input_mat = cbind(new_col, input_mat) > input_numbers = (input_numbers - new_co

Re: [R] data.frame() size

2005-12-08 Thread Peter Dalgaard
Matthew Dowle <[EMAIL PROTECTED]> writes: > Hi, > > In the example below why is d 10 times bigger than m, according to > object.size ? It also takes around 10 times as long to create, which fits > with object.size() being truthful. gcinfo(TRUE) also indicates a great deal > more garbage collecto

Re: [R] scoping issues?

2005-12-08 Thread tom wright
Thanks for the answers, yup the missing c() was what was throwing me. And thanks Barry for the slighly more elegant code, I'm a bit post christmas party here and not thinking as straight as I should be. On Thu, 2005-08-12 at 06:47 -0500, tom wright wrote: > Can anyone please help me understand w

Re: [R] scoping issues?

2005-12-08 Thread Barry Rowlingson
tom wright wrote: > Browse[1]> mean(amps[1],amps[2],amps[3],amps[7],amps[8]) > [1] 1 For starters, this just returns mean(amps[1]). 'mean' computes the mean of the first argument, the others are slurped up by '...' and in this case thrown into the bin. You want to do mean(c(amps[1],amps[2

Re: [R] Commented version of the home page graphics code

2005-12-08 Thread Philippe Grosjean
Hello, Have you tried to ask its author directly (Eric Lecoutre <[EMAIL PROTECTED]>)? Best, Philippe Grosjean Satsangi, Vivek wrote: > Folks, > I was drawn to R, like many others, partly for the opportunity > to draw nice, colorful graphs (occasionally ones with meaning, too :-) > ). I am

Re: [R] scoping issues?

2005-12-08 Thread Jan T. Kim
On Thu, Dec 08, 2005 at 06:47:05AM -0500, tom wright wrote: > Can anyone please help me understand whats happening here? > Thanks > Tom > > getAmpRatio<-function(v_amps){ > #calculates the amplitude ratios between the 3 largest amps and the > rest > bigamp<-0 > map<-rep(TRUE,length(v_a

[R] data.frame() size

2005-12-08 Thread Matthew Dowle
Hi, In the example below why is d 10 times bigger than m, according to object.size ? It also takes around 10 times as long to create, which fits with object.size() being truthful. gcinfo(TRUE) also indicates a great deal more garbage collector activity caused by data.frame() than matrix(). $ R

[R] reg peak detection

2005-12-08 Thread SHRIRAM R SAMPAT
Hallo everybody, I am doing a thesis in video extensometry and one my approaches requires peak detection in a two dimensional data. If would be grateful if anyone can throw some light on this for me by giving me some hints on how to do it or give me some links for it. thank very much in advance.

[R] sequential patterns

2005-12-08 Thread Christoph Kainrath
Is there or will there be an implementation of sequential patterns (temporal association rules) for R? Kind regards christoph [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listin

[R] Commented version of the home page graphics code

2005-12-08 Thread Satsangi, Vivek
Folks, I was drawn to R, like many others, partly for the opportunity to draw nice, colorful graphs (occasionally ones with meaning, too :-) ). I am still quite a newbie to R. As such, I have been trying to understand the code for the graphics on the home page (the ones from the 2004 contes

[R] Digests of R-help -- minor mess (unicode character set problems)

2005-12-08 Thread Martin Maechler
Again (as earlier last week) it happened that some of the postings to R-help were using a version of unicode that seemed invalid to the unicode-handler (for the digest) inside Mailman (the mailing list software). As a consequence, yesterday's and today's daily digests were not sent out. This time,

[R] scoping issues?

2005-12-08 Thread tom wright
Can anyone please help me understand whats happening here? Thanks Tom getAmpRatio<-function(v_amps){ #calculates the amplitude ratios between the 3 largest amps and the rest bigamp<-0 map<-rep(TRUE,length(v_amps)) for(iLoc in 1:3){ bigamp<-bigamp+max(v_amps) map[wh

Re: [R] Finding all possible partitions of N units into k classe

2005-12-08 Thread Ted Harding
On 08-Dec-05 Ales Ziberna wrote: > Dear useRs! > > I would like to generate a list of all possible (unique) > partitions of N units into k classes. For example, all possible > partitions of 4 units into 2 classes are (I hope I have not > missed anyone): > > 1,1,1,2 (this can be read as {1,2,3},{4

Re: [R] figure with inset

2005-12-08 Thread Gregory Snow
There is a subplot command in the latest version of the TeachingDemos package (version 1.1 available today) that does what you want using traditional graphics (others have given suggestions using grid graphics). An example: > x <- 0:10 > y <- x^4 > plot(x,y,xaxs='i',yaxs='i') > subplot( plot(x,y,

Re: [R] concatenate data frame

2005-12-08 Thread Don MacQueen
Having no idea what the object "no" is, or what the object "off_set" is, it is difficult to understand what you are trying to do. Perhaps if you substituted simple numbers in the example, such as tab[ 1:5, 15] it would be easier to understand. Perhaps what you really want is cbind() or rbi

Re: [R] lower case Greek letters

2005-12-08 Thread Prof Brian Ripley
On Thu, 8 Dec 2005, Matt Pocernich wrote: > I am having difficulties creating lower case Greek letters. > > For example > > plot(0,0, type = "n") > > text(-0.5,1, expression(beta) ) > text( 0.5,1, expression(alpha) ) > > produce the upper case letters B and A. > > Running > > demo("plotmath") > In

Re: [R] Finding all possible partitions of N units into k classes

2005-12-08 Thread Ingmar Visser
combinations in the gtools package can be helpfull here, best, ingmar > From: "Ales Ziberna" <[EMAIL PROTECTED]> > Date: Thu, 8 Dec 2005 15:45:37 +0100 > To: "R-help" > Subject: [R] Finding all possible partitions of N units into k classes > > Dear useRs! > > > > I would like to generate a li

Re: [R] Listing all possible samples of size n form a population

2005-12-08 Thread Ales Ziberna
I would like to thank Ted Harding and Kristel Joossens for their replies! They both work perferctly. I would also like to appologize for not finding the package combinat myself! Thank you aggain, Ales Ziberna - Original Message - From: "Ted Harding" <[EMAIL PROTECTED]> To: "Ales Ziber

[R] lower case Greek letters

2005-12-08 Thread Matt Pocernich
Hello, I am having difficulties creating lower case Greek letters. For example plot(0,0, type = "n") text(-0.5,1, expression(beta) ) text( 0.5,1, expression(alpha) ) produce the upper case letters B and A. Running demo("plotmath") In the Symbolic Names Alpha - Omega ! 7 alpha - omega

Re: [R] kronecker(... , make.dimnames=TRUE)

2005-12-08 Thread Gabor Grothendieck
Not sure whether or not this is a good idea but note that the techniques discussed in the recent thread: "Change labels of x-axes in Plot of stl() function?" can be used here too. e.g. library(proto) kronecker <- function(...) { outer <- function(x, y, FUN, sep) {

Re: [R] Listing all possible samples of size n form a population

2005-12-08 Thread Ted Harding
On 08-Dec-05 Ales Ziberna wrote: > Dear useRs! > > I would like to list all possible samples of size n form a > population of size N. Obviously, N must be small (up to 20??) > for this to be possible. > > For example, let say that N = 3 and n = 2. Therefore, we can > say we have units 1, 2 and 3.

[R] RSPerl from perl and perl arrays

2005-12-08 Thread Sean Davis
RSPerl is an omegahat project. Just a quick question--I am playing with RSPerl (MacOS X, R2.2.0,perl 5.8.6, RSPerl 0.8.0). Quite cool! I am interested in taking a two-D array in perl and calling a function in R on it. Is there a way to pass the array across to R without it being coerced to the

Re: [R] Bandwidth selection for ksmooth( )

2005-12-08 Thread Prof Brian Ripley
Please stop sending the same message over and over again (I see it 3 times in the archive), using HTML mail which we specifically ask you not to in the posting guide. You are using a bandwidth selector for density() with ksmooth(). You seem still not to have read the help page for ksmooth, whic

Re: [R] reference for a fortune quote

2005-12-08 Thread Peter Dalgaard
Rajarshi Guha <[EMAIL PROTECTED]> writes: > Hi, there is a quote in the fortunes package: > > To paraphrase provocatively, `machine learning is statistics minus any > checking > of models and assumptions'. >-- Brian D. Ripley (about the difference between machine learning and > statisti

[R] Finding all possible partitions of N units into k classes

2005-12-08 Thread Ales Ziberna
Dear useRs! I would like to generate a list of all possible (unique) partitions of N units into k classes. For example, all possible partitions of 4 units into 2 classes are (I hope I have not missed anyone): 1,1,1,2 (this can be read as {1,2,3},{4}) 1,1,2,1 1,2,1,1 2,1,1,1 1,1,2,2 1,2,1

[R] Listing all possible samples of size n form a population of size N

2005-12-08 Thread Ales Ziberna
Dear useRs! I would like to list all possible samples of size n form a population of size N. Obviously, N must be small (up to 20??) for this to be possible. For example, let say that N = 3 and n = 2. Therefore, we can say we have units 1, 2 and 3. I believe all possible samples are : {1,

[R] reference for a fortune quote

2005-12-08 Thread Rajarshi Guha
Hi, there is a quote in the fortunes package: To paraphrase provocatively, `machine learning is statistics minus any checking of models and assumptions'. -- Brian D. Ripley (about the difference between machine learning and statistics) useR! 2004, Vienna (May 2004) Was this statem

Re: [R] R coding style (was R is GNU S, not C....)

2005-12-08 Thread vincent
Prof Brian Ripley a écrit : > I had already posted this in this thread: it is in sections 3.1 > and Appendix B of `Writing R Extensions'. Dear Prof Ripley, I am certainly missing something. I did read http://cran.r-project.org/doc/manuals/R-exts.html#Tidying-R-code which is section 3.1 of `Wri

Re: [R] all (y,x) data in one plot

2005-12-08 Thread Sundar Dorai-Raj
Or use lattice: x <- list(data.frame(a = 1:10, b = rnorm(10)), data.frame(a = 1:9, b = rnorm(9) + 5)) ## create grouping variable g <- rep(seq(along = x), sapply(x, nrow)) ## if `x' has names then replace by ## g <- rep(names(x), sapply(x, nrow)) z <- cbind(do.call("rbind", x), g = g)

Re: [R] 'mean' and 'sd' calculations do not match

2005-12-08 Thread Peter Dalgaard
Ulrich Leopold <[EMAIL PROTECTED]> writes: > Dear list, > > I am using R 2.1.1 on a Fedora 3 Linux, 32 bit PC. > > If I compute the aggregated mean and the standard deviation I get > standard deviation values for factors where the mean was not computed. > It seems to me that this is somehow rela

Re: [R] 'mean' and 'sd' calculations do not match

2005-12-08 Thread Petr Pikal
Hi you see the differenc between factors and numbers. columns with are factors columns with NA ar numeric you can see it by str(chemicS) which will reveal a structure of your data So either change factors by as.numric(as.character()) or read it with forcing columns to numeric ?read.table

Re: [R] all (y,x) data in one plot

2005-12-08 Thread Petr Pikal
Hi yesterday was answered similar list question (do.call is your friend) lll<- list(data.frame(a=1:10,b=rnorm(10)), data.frame(a=1:9,b=rnorm(9)+5)) mat <- sapply(lll, dim) plot(do.call("rbind",lll), pch=rep(1:dim(mat)[2], times=as.numeric(mat[1,]))) HTH Petr On 8 Dec 2005 at 17:59, Judy Chun

Re: [R] Statistics-R module for Perl

2005-12-08 Thread Sean Davis
On 12/8/05 6:29 AM, "béline jesson" <[EMAIL PROTECTED]> wrote: > Le 8/12/05 12:12, « Sean Davis » <[EMAIL PROTECTED]> a écrit : > >> >> >> >> On 12/8/05 5:20 AM, "béline jesson" <[EMAIL PROTECTED]> wrote: >> >>> >>> Hello! >>> >>> I interest of using Perl for application of biostatistcs

Re: [R] Statistics-R module for Perl

2005-12-08 Thread Sean Davis
On 12/8/05 5:20 AM, "béline jesson" <[EMAIL PROTECTED]> wrote: > > Hello! > > I interest of using Perl for application of biostatistcs with R. I find your > module on the cpan's site. But, I've a question: > Could I use it with Mac OS X? Because I have this error: > "Error: no suitable instal

Re: [R] truncate/overwrite a data frame

2005-12-08 Thread P Ehlers
Guillaume, Will functions unique() or duplicated() help you? (Comment on trailing ";" withheld so as not to revive recent thread.) Peter Ehlers [EMAIL PROTECTED] wrote: > hi all, > > I've got a data frame, this data frame have 76 columns and 22600 rows. > The data inside can be redundant becau

[R] 'mean' and 'sd' calculations do not match

2005-12-08 Thread Ulrich Leopold
Dear list, I am using R 2.1.1 on a Fedora 3 Linux, 32 bit PC. If I compute the aggregated mean and the standard deviation I get standard deviation values for factors where the mean was not computed. It seems to me that this is somehow related to the NA values. But I don't quite understand what is

[R] statistical matching

2005-12-08 Thread Kmetty Zoltan
Hy! Now im doing a statistical matching (datafusion) microsimulation project, and i try to programme it in R. Has everybody any experience (R codes, which package to use...) in this theme? Zoltan Kmetty Hungarian Central Statistical Office [[alternative HTM

[R] kronecker(... , make.dimnames=TRUE)

2005-12-08 Thread Robin Hankin
Hi I'm using kronecker() with a matrix and a vector. I'm interested in the column names that kronecker() returns: > a <- matrix(1:9,3,3) > rownames(a) <- letters[1:3] > colnames(a) <- LETTERS[1:3] > b <- c(x=1,y=2) > kronecker(a,b,make.dimnames=TRUE) A: B: C: a:x 1 4 7 a:y 2 8

[R] Bandwidth selection for ksmooth( )

2005-12-08 Thread Amir Safari
Dear R Users, Before running ksmooth( ), a suitable bandwidth selection is needed. I use some functions for this task and receive these results for my data: width.SJ(y,nb=100,method="ste") : 40.25 bcv(y,nb=100) : 40.53 ucv(y): 41.26 bandwidth.nrd(y) : 45.43 Af

[R] Statistics-R module for Perl

2005-12-08 Thread béline jesson
Hello! I interest of using Perl for application of biostatistcs with R. I find your module on the cpan's site. But, I've a question: Could I use it with Mac OS X? Because I have this error: "Error: no suitable installation target found for package Statistics-R." If it's not possible with this scr

Re: [R] how to change a dataframe with characters to a numeric matrix?

2005-12-08 Thread Jacques VESLOT
you probably have a dataframe like this : z <- data.frame(y1=c(1,2,3),y2=c(4,5,6),y3=c(4,"z",5)) you can do : z <- as.matrix(z) mode(z) <- "numeric" zhihua li a écrit : > hi netters, > > i have a dataframe TEST like this: > > Y1 Y2 Y3 > X1 4 7 8 > X2 6 2 Z > X3 8 0 1 > > i would like to chang

Re: [R] Hmisc latex format.df by row formatting?

2005-12-08 Thread Dieter Menne
Dieter Menne menne-biomed.de> writes: > > Using Hmisc, I get the following output from format.df (which will feed to > latex) > >Min Q1 Med Mean Q3 Max > Age" 30" " 32.5" " 36" " 37.50" " 41.00" " 49" > Height "174" "175.0" "178" "179.00" "181.00" "188" > Weight

[R] all (y,x) data in one plot

2005-12-08 Thread Judy Chung
Dear R users: I want to plot all the Y1 vs. X1 which in list "coffee" together, in the same plot. > coffee [[1]] Y1X1 1 0.0 10.006306 2 0.5 9.433443 3 1.0 8.893405 4 2.0 7.904274 [[2]] Y1X1 1 0.0 10.015972 2 0.5 9.460064 3 1.0 8.935039 4 2.0 7.970755 [[3]] Y

Re: [R] how to change a dataframe with characters to a numeric matrix?

2005-12-08 Thread David Hajage
and then, if you want a matrix and not a data.frame : TEST <- as.matrix(TEST) 2005/12/8, David Hajage <[EMAIL PROTECTED]>: > > A way to do it : > > TEST$Y3[TEST$Y3=="Z"] <- NA > > TEST$Y3 <- as.numeric(TEST$Y3) > > > 2005/12/8, zhihua li <[EMAIL PROTECTED]>: > > > > hi netters, > > > > i have a

Re: [R] how to change a dataframe with characters to a numeric matrix?

2005-12-08 Thread David Hajage
A way to do it : TEST$Y3[TEST$Y3=="Z"] <- NA TEST$Y3 <- as.numeric(TEST$Y3) 2005/12/8, zhihua li <[EMAIL PROTECTED]>: > > hi netters, > > i have a dataframe TEST like this: > > Y1 Y2 Y3 > X1 4 7 8 > X2 6 2 Z > X3 8 0 1 > > i would like to change it to a numeric matrix, replacing "Z"

[R] Hmisc latex format.df by row formatting?

2005-12-08 Thread Dieter Menne
Using Hmisc, I get the following output from format.df (which will feed to latex) Min Q1 Med Mean Q3 Max Age" 30" " 32.5" " 36" " 37.50" " 41.00" " 49" Height "174" "175.0" "178" "179.00" "181.00" "188" Weight " 68" " 74.0" " 78" " 76.67" " 79.75" " 83" Automatic d

[R] truncate/overwrite a data frame

2005-12-08 Thread [EMAIL PROTECTED]
hi all, I've got a data frame, this data frame have 76 columns and 22600 rows. The data inside can be redundant because the data can be captured simultaneously and overlap each other. My aim is to supress these overlaps I've test some solutions to do that but they all give a big cpu load and ea

Re: [R] Reshaping data

2005-12-08 Thread Peter Dalgaard
"Rau, Roland" <[EMAIL PROTECTED]> writes: > Dear all, > > given I have data in a data.frame which indicate the number of people in > a > specific year at a specific age: > > n <- 10 > mydf <- data.frame(yr=sample(1:10, size=n, replace=FALSE), >age=sample(1:12, size=n, replac

Re: [R] Reshaping data

2005-12-08 Thread Rau, Roland
Hi, thank you very much for your fast reply. It worked fine. In the meantime, I also had now an idea using a function from the apply-family (see below for the code). The more I use R, the more I get the impression that either "the apply-family" or outer() can solve most of my data-transformation

[R] how to change a dataframe with characters to a numeric matrix?

2005-12-08 Thread zhihua li
hi netters, i have a dataframe TEST like this: Y1 Y2 Y3 X1 4 7 8 X2 6 2 Z X3 8 0 1 i would like to change it to a numeric matrix, replacing "Z" with NA Y1 Y2 Y3 X1 4 7 8 X2 6 2 NA X3 8 0 1 i've tried the function data.matrix but it didn't work. is there any easy way to

Re: [R] weighted m-estimator

2005-12-08 Thread Prof Brian Ripley
On Thu, 8 Dec 2005, Daniel Metzler wrote: > Dear R listers, > > I'm trying use Huber's m-estimator on a dataset, which works fine so > far. Huber's M-estimator of what? Location, scale, regression, AR coefficients What software are you using to do so? > In the next step I would like to a

Re: [R] Reshaping data

2005-12-08 Thread Dimitris Rizopoulos
just try mymatrix <- matrix(0, 12, 10) mymatrix[cbind(mydf$age, mydf$yr)] <- mydf$no mymatrix I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32

[R] Reshaping data

2005-12-08 Thread Rau, Roland
Dear all, given I have data in a data.frame which indicate the number of people in a specific year at a specific age: n <- 10 mydf <- data.frame(yr=sample(1:10, size=n, replace=FALSE), age=sample(1:12, size=n, replace=FALSE), no=sample(1:10, size=n, replace=

[R] weighted m-estimator

2005-12-08 Thread Daniel Metzler
Dear R listers, I'm trying use Huber's m-estimator on a dataset, which works fine so far. In the next step I would like to assign a (frequency) weight to the observations. It seemed straight forward to me to replicate the rows according to their count variable. Unfortunately, a solution p

Re: [R] contrasts for lm

2005-12-08 Thread Dieter Menne
Ann Hess stat.colostate.edu> writes: > > Here is my model statement: > > Model<-lm(log2PM~P+T+P*T) > > where P has 16 levels, T(treatment) has 12 levels and I am interested in > looking at different treatment comparisons. With so many levels, you should do something against fishing for error