Re: [R] sorting a data.frame by mean values of grouped data

2008-03-12 Thread sjbarry
Thanks Mark, I see that I made an error in my original request for help. I got my labels and groups mixed up (see below). Nonetheless, your code has been a good pointer in the direction of a solution. I'll post it up when I have it working. Thanks again, Stephen Barry. I should have written i

Re: [R] survival analysis and censoring

2008-03-12 Thread Geoff Russell
Dear Prof. Therneau, Many thanks for this, On 3/13/08, Terry Therneau <[EMAIL PROTECTED]> wrote: > > In your particular case I don't think that censoring is an issue, at least > not > for the reason that you discuss. The basic censoring assumption in the Cox > model is that subjects who are

Re: [R] sorting a data.frame by mean values of grouped data

2008-03-12 Thread Mark W Kimpel
Stephen, I am sure someone will have a more elegant solution, but the following works. Mark d.lst <- split(x = d, f = as.factor(d$Group), drop = FALSE) d.lst.mn <- sapply(d.lst, FUN = function(x){mean(as.numeric(as.character(x$Value)))}) o <- order(d.lst.mn, decreasing = TRUE) d.lst.mn <- d.lst

[R] sorting a data.frame by mean values of grouped data

2008-03-12 Thread sjbarry
Hi, I have what I think is a fairly straightforward problem. I've looked through the FAQ's and mailing lists but have been unable to identify a solution, probably because I don't understand the language well enough. I have a set of data d, with 3 columns as shown, I want to sort the data Group,

Re: [R] regular expressions

2008-03-12 Thread Christos Hatzis
Try this one: > gsub("^(plif)([a-z]*)", "\\1ONE", words) [1] "plifONE" "plafboum" "ploufbang" "plifONE" -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of GOUACHE David > Sent: Wednesday, March 12, 2008 12:15 PM > To: [EMAIL PROTECTED]

[R] regular expressions

2008-03-12 Thread GOUACHE David
Hello all, Still fighting with regular expressions and such, I am again stuck: Suppose I have a vector of character chains. In this vector, I wish to identify which character chains start with a given pattern, and then replace everything that comes after said pattern. Here is a quick exampl

Re: [R] Data Structures

2008-03-12 Thread Rolf Turner
?list On 13/03/2008, at 3:50 PM, Scott Romans wrote: > Matlab has an aggregate variable called a structure, which consists of > component variables each of which can be of a different data type and > dimension. For example, I can have a single structure Model which > consists of Model.variable1,

Re: [R] Data Structures

2008-03-12 Thread Erik Iverson
Hello - Scott Romans wrote: > Matlab has an aggregate variable called a structure, which consists of > component variables each of which can be of a different data type and > dimension. For example, I can have a single structure Model which > consists of Model.variable1, Model.variable2, and

[R] Data Structures

2008-03-12 Thread Scott Romans
Matlab has an aggregate variable called a structure, which consists of component variables each of which can be of a different data type and dimension. For example, I can have a single structure Model which consists of Model.variable1, Model.variable2, and Model.variable3, where variable1 i

Re: [R] Convert a List of Distances to a Distance Matrix

2008-03-12 Thread jim holtman
Here is one way of doing it: > x <- read.table(textConnection("A A 0 + A B .5 + A C .25 + B C .5"), as.is=TRUE) > closeAllConnections() > # get the unique names > x.names <- sort(unique(c(x[[1]], x[[2]]))) > # create a matrix of the right size and put names on it > x.dist <- matrix(0, length(x.nam

Re: [R] type of object of a variable in a data frame

2008-03-12 Thread Daniel Malter
is(data$V1) Have a look at the refcard that you can download from cran.r-project.org or please take a look at one of the many other manuals that are provided there for free (many manuals are also available elsewhere on the internet, so you can google them). Almost all of them answer these basic qu

Re: [R] transpose dataset

2008-03-12 Thread Daniel Malter
if x is your data: t(x) - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Felipe Carrillo Gesendet: Wednesday, March 12, 2008 8:19 PM An: [EMAIL PROTECTED] Betreff: [R]

[R] Convert a List of Distances to a Distance Matrix

2008-03-12 Thread Charles Willis
Hello, Is there an easy function for switching list to matrix. My list is of genetic distances between species pairs: A A 0 A B .5 A C .25 B C .5 and I want a distance matrix such as: A B C A 0 .5 .25 B .5 0 .5 C .25 .5 0 for use in a mantel test. Thank you for the help! cheers, charl

Re: [R] Distances between two datasets of x and y co-ordinates

2008-03-12 Thread Bill.Venables
Here's what I would try. Suppose x1, y1 and x2, y2 are the two data sets. z1 <- complex(real = x1, imaginary = y1) z2 <- complex(real = x2, imaginary = y2) dMat <- outer(z1, z2, function(z1, z2) Mod(z1-z2)) Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (emai

[R] transpose dataset

2008-03-12 Thread Felipe Carrillo
Hi all: How can I transpose this dataset from column to row idweek value 1 5 51 2 6 73 3 7 41 4 8 22 5 9 83 6 10 55 7 11 42 to something like this... id1 2 3 4 5 6 7 week 5 6 7 8 9 10 11 value 51 73 41

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Bill.Venables
Here is one way. ... usr <- par("usr") # get user coordinates par(usr = c(0, 1, 0, 1)) # new relative user coordinates text(0.1, 0.5, "Some text", adj = 0) # if that's what you want par(usr = usr) # restore original user coordinates ... If you were going to be d

[R] survival curve for only certain values of a factor

2008-03-12 Thread Chang Liu
Hello: Using the built-in dataset aml as an example: data(aml) If I use instead dummy variables: aml$x1 = (aml$x=="maintained")aml$x2 = (aml$x=="unmaintained") and I want to plot the survival curve using x1, x2, and I just want the 2 levels, rather than 4 curves from: fit <- survfit(Surv(

Re: [R] subset list based on logical within element flag

2008-03-12 Thread Christos Hatzis
Try: > names(which(my_list == 'Fred')) [1] "name" You can break down the two nested calls to figure out what is happening. -Christos > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Srinivas Iyyer > Sent: Wednesday, March 12, 2008 6:53 PM > To: Be

Re: [R] type of object of a variable in a data frame

2008-03-12 Thread Gabor Grothendieck
class(data) class(data$V1) str(data) str(data$V1) dput(data) dput(data$V1) On Wed, Mar 12, 2008 at 7:17 PM, Chang Liu <[EMAIL PROTECTED]> wrote: > > Hello! > I have used read.csv to read in a data frame, and there are a few variables > in it, however, when I tried > is.list(data$V1) > >FALSE > In

[R] type of object of a variable in a data frame

2008-03-12 Thread Chang Liu
Hello! I have used read.csv to read in a data frame, and there are a few variables in it, however, when I tried is.list(data$V1) >FALSE In fact, I have tried, they are not vectors either. I'm wondering: 1. What objects are these "lists" of data? 2. How could I find out about the type/inherite

Re: [R] subset list based on logical within element flag

2008-03-12 Thread Srinivas Iyyer
Hi I have the smililar question. I have a list: my_list <- list(name="Fred", wife="Mary", no.children=3, child.ages=c(4,7,9)) > my_list $name [1] "Fred" $wife [1] "Mary" $no.children [1] 3 $child.ages [1] 4 7 9 Now I want to search "Fred" and get attribute of that value which is 'name'.

[R] Negative/ positive rolling correlation

2008-03-12 Thread Rthoughts
Hi everybody, I really appeciate the help you have given me. I am getting around R comfortably now and am able to import research project data, do mathematical analysis of the data and produce graphs. My PhD project is going really well in its early days, already collecting data and proposal compl

[R] howto find corresponding values in datasource?

2008-03-12 Thread Jonas Stein
Hi, i am sure, that this is a noob-question, but i have searched for hours without any good result. I want to draw a vertical line through the maximum of the first derivation. Here is a small example. --8<-[mydata.csv] HM 115 222 323 4

Re: [R] subset list based on logical within element flag

2008-03-12 Thread Prof Brian Ripley
I'm not sure exactly what you want, but try something like lapply(gene.pair.tf.lst, function(x) if(x$sig.cor) x$gene.pair) If you only want the non-NULL entries (and how would you know which they are, given you have duplicates?) gene.pair.tf.lst <- list(list(gene.pair="Lgals1:Pxmp2", sig.cor=FA

Re: [R] subset list based on logical within element flag

2008-03-12 Thread Benilton Carvalho
gene.pair.tf.lst[sapply(gene.pair.tf.lst, "[[", "sig.cor")] b On Mar 12, 2008, at 5:24 PM, Mark W Kimpel wrote: I have a very long list that I'd like to subset based on a logical value within each element. Example below. I'd like to get just those list elements for further study whose $sig.

[R] subset list based on logical within element flag

2008-03-12 Thread Mark W Kimpel
I have a very long list that I'd like to subset based on a logical value within each element. Example below. I'd like to get just those list elements for further study whose $sig.cor slot is TRUE. In this example, I'd only want element [[2]]. Should be simple, I know. How can I do this? Thanks,

Re: [R] question for aov and kruskal

2008-03-12 Thread Rolf Turner
I thought your question was well expressed and that you followed the posting guide better than most. I'm no expert on such issues, but I'd like to kick in a few opinions (with which others may disagree). (1) All of the anova stuff is based on the assumption of homogeneity of variance. Howe

Re: [R] Distances between two datasets of x and y co-ordinates

2008-03-12 Thread Sundar Dorai-Raj
Andrew McFadden said the following on 3/12/2008 1:47 PM: > Hi all > > I am trying to determine the distances between two datasets of x and y > points. The number of points in dataset One is very small i.e. perhaps > 5-10. The number of points in dataset Two is likely to be very large > i.e. 20,

[R] Problem with approximate null distribution (package: coin)

2008-03-12 Thread Ivan Adzhubey
Hi, I am trying to make use of "approximate" option to obtain null distribution through Monte-Carlo resampling, as described in coin library documentation. Unfortunately, this does not play well with my data -- permutation process swallows astonishingly large amounts of RAM (4-5Gb) and runs far

[R] Distances between two datasets of x and y co-ordinates

2008-03-12 Thread Andrew McFadden
Hi all I am trying to determine the distances between two datasets of x and y points. The number of points in dataset One is very small i.e. perhaps 5-10. The number of points in dataset Two is likely to be very large i.e. 20,000-30,000. My initial approach was to append the first dataset to the

Re: [R] internet proxy settings (win)

2008-03-12 Thread Philipp Kauer
Hi Thomas maybe try the following: 1) start R with option "C:\Program Files\R\R-2.6.2\bin\Rgui.exe" -- internet2 2) disable anything in your Rprofile.site and .Rprofile to have a clean start of R I recently upgraded from an earlier version of R to v 2.6.2, and was using all my old libs, and

Re: [R] question for aov and kruskal

2008-03-12 Thread eugen pircalabelu
Hi, My data was only a toy example that matched the real situation, with real data, but i could not have posted the entire data.set and so i gave a self contained example of what i thought was my problem. Of course you can see with the naked eye that the data is unbalanced, (this was done inten

Re: [R] Problem with specifiying column widths in layout

2008-03-12 Thread Greg Snow
The problem with your code is that you are passing widths to the matrix function instead of the layout function. The matrix function does not know what you want to do with the "widths" and gives the error. Move that section to between the last 2 parentheses: > layout( matrix( 1:9, ncol=3, byrow=

[R] Problem with specifiying column widths in layout

2008-03-12 Thread Peter H Singleton
I am trying to generate a graphic with a matrix of 9 line graphs (3 rows, 3 columns), all with the same y-axis range, and only showing the y-axis labels and title at the left edge of each row of the matrix. I have been trying to use the widths argument in layout to specify a larger column width in

Re: [R] generalized linear mixed models with a beta distribution

2008-03-12 Thread Prof Brian Ripley
glmmPQL can fit the same GLM families as glm() can -- it does not list _any_ . Howver, the beta distribution does not give a GLM family and hence your subject line is strictly about a non-existent concept. I'm presuming that you want to model the logit of the mean of a beta by a random effects

[R] Re peated Measures (lme?)

2008-03-12 Thread francogrex
Hello, I have a general data analysis question. I recently visited a lab where they are testing a new treatment and they had done the experiment several times on different dates. They repeated the experiment 3-5 times per day. And then for practical reasons they repeated the whole procedure fo

Re: [R] glm.fit: "fitted probabilities numerically 0 or 1 occurr

2008-03-12 Thread Werner Wernersen
Thanks Ted and Professor Ripley for the very helpful answers! Now I know what the problem is in my case. All the best, Werner --- [EMAIL PROTECTED] schrieb: > On 11-Mar-08 08:58:55, Werner Wernersen wrote: > > Hi, > > > > could anyone explain to me what this warning > message > > exactly me

Re: [R] SPSS import problem

2008-03-12 Thread Prof Brian Ripley
On Wed, 12 Mar 2008, K. Elo wrote: > Hi again, > > many thanks for Your answers. So, if I understood Wei right: > > Zhao, Wei (Cancer Center) wrote (12.3.2008): >> I had a similar problem when read one of my spss.sav with long >> variable label. But when I read another spss.sav with short label th

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Prof Brian Ripley
On Wed, 12 Mar 2008, Nordlund, Dan (DSHS/RDA) wrote: >> -Original Message- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Monteiro >> Sent: Wednesday, March 12, 2008 10:28 AM >> To: Tom La Bone; r-help@r-project.org >> Subject: Re: [R] Specifying relative posi

Re: [R] SPSS import problem

2008-03-12 Thread K. Elo
Hi again, many thanks for Your answers. So, if I understood Wei right: Zhao, Wei (Cancer Center) wrote (12.3.2008): > I had a similar problem when read one of my spss.sav with long > variable label. But when I read another spss.sav with short label the > same way, I don't have problem. > Seems li

[R] R code for kernel density using kd-tree, looking for speed up

2008-03-12 Thread alsoRun
Dear R-help-list, The following is R function I wrote for computing multi-dimensional kernel density. I am seeking R experts who can make the code to run faster, 50 times faster ideally. Specifically, for function kernel.estimate = function(points, bw), the argument points is a d by n matrix

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Greg Snow
To left justify the text rather than center, use the adj argument, this is easier and probably more reliable than trying to adjust the x coordinate manually. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Mess

Re: [R] default values

2008-03-12 Thread Prof Brian Ripley
On Wed, 12 Mar 2008, Dwayne Blind wrote: > Dear R users, > > I wrote the following toy example to explain my problem : > > a=0 > f=function(x,y,z) { >if (a==0) x[1]+x[2]+y >if (a!=0) x[1]+x[2]+y+z > } > f(1:2,3) > > > I have not specified z and I get an error. What was the error? It work

[R] generalized linear mixed models with a beta distribution

2008-03-12 Thread Craig A Faulhaber
Greetings, I am interested in using a generalized linear mixed model with data that best fits a beta distribution (i.e., the data is bounded between 0 and 1 but is not binomial). I noticed that the beta distribution is not listed as an option in the "family objects" for glmmPQL or lmer. I f

Re: [R] default values

2008-03-12 Thread Ravi Varadhan
You just need to return the values computed when a==0 and when a!=0. a=0 f=function(x,y,z=0) { if (a==0) return(x[1]+x[2]+y) if (a!=0) return(x[1]+x[2]+y+z) } > f(1:2,3) [1] 6 > Ravi. --- Ravi Varadhan, Ph

Re: [R] survival analysis and censoring

2008-03-12 Thread Terry Therneau
In your particular case I don't think that censoring is an issue, at least not for the reason that you discuss. The basic censoring assumption in the Cox model is that subjects who are censored have the same future risk as those who were a. not censored and b. have the same covariates.

Re: [R] Types of quadrature

2008-03-12 Thread Prof Brian Ripley
Note that integrate accepts upper=Inf. All that is needed is to read the help and do as it asks. On Wed, 12 Mar 2008, Lüthi David (luda) wrote: Dear R-users I would like to integrate something like \int_k^\infty (1 - F(x)) dx, where F(.) is a cumulative distribution function. As mentioned in

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread hadley wickham
> mm1 <- cast(mm, Class~Name) > aba <- mm1[,2:6] > aba[is.na(aba)] <- 1 > final <- data.frame(mm1$Class, aba) > names(final) <- names(mm1) > final You can abbreviate all this to: final <- cast(mm, Class ~ Name, fill = 1) Hadley -- http://had.co.nz/ _

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Monteiro > Sent: Wednesday, March 12, 2008 10:28 AM > To: Tom La Bone; r-help@r-project.org > Subject: Re: [R] Specifying relative position of text in a plot > > > Tom La Bone asked: > > > > W

Re: [R] Types of quadrature

2008-03-12 Thread Ravi Varadhan
Hi, Why do you need an extension of integrate()? integrate() is adaptive - it uses an adaptive Gauss-Kronrod quadrature. You can specify Inf and -Inf as upper and lower limits, resp., in integrate(). In fact, this is what the help page recommends, and it also discourages the use of a large numb

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread John Kane
Oops, I just realised that you asked for a matrix not a data.frame Substituing for the last three lines of code final <- as.matrix(aba) colnames(final) <- aa$Name rownames(final) <- mm1$Class should do it. --- John Kane <[EMAIL PROTECTED]> wrote: > The way that you have set up the data.frame

[R] default values

2008-03-12 Thread Dwayne Blind
Dear R users, I wrote the following toy example to explain my problem : a=0 f=function(x,y,z) { if (a==0) x[1]+x[2]+y if (a!=0) x[1]+x[2]+y+z } f(1:2,3) I have not specified z and I get an error. Although a=0, R seems to want to know z because it's in the expression x[1]+x[2]+y+z. So I

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread John Kane
The way that you have set up the data.frame is rather unusual. It makes NES a factor which I suspect you don't want. Do str(xx) to see what I mean Here is a way that I think does what you want but with the data.frame constructed in a different manner. Again do str(aa) to see the difference ==

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread Henrique Dallazuanna
Try: xy <- with(xx, tapply(NES, list(Class, Name), paste)) xy[is.na(xy)] <- 1 On 12/03/2008, Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Hi Henrique, > Thanks for your tip. > > > how can I map xx onto xy (where xy is a matrix I > created). > > > > > > > xy > Mike Carl Gene James Dough >

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread Srinivas Iyyer
Hi Henrique, Thanks for your tip. how can I map xx onto xy (where xy is a matrix I created). > > > xy Mike Carl Gene James Dough A111 1 1 C111 1 1 B111 1 1 If I can map xx onto xy, I can have '1' without NAs. Thanks Srini

[R] Types of quadrature

2008-03-12 Thread luda
Dear R-users I would like to integrate something like \int_k^\infty (1 - F(x)) dx, where F(.) is a cumulative distribution function. As mentioned in the "integrate" help-page: integrate(dnorm,0,2) ## fails on many systems. This does not happen for an adaptive Simpson or Lobatto quadrature (

Re: [R] Converting a data frame with values into a matrix/

2008-03-12 Thread Henrique Dallazuanna
Perhaps in this case: noquote(with(xx, tapply(NES, list(Class, Name), paste))) On 12/03/2008, Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Dear Group, > I have a data frame like the following: > > > x <- c("Mike","A",0.01) > x1 <- c("Carl","A",0.2) > x2 <- c("Gene","C",0.3) > x3 <- c("James"

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Greg Snow
I tested the main set of examples from cnvrt.coords using the new grconvert functions and they worked perfectly. I have already noted in the help page for cnvrt.coords (for the next version coming out soon) that people should start using grconvertX and grconvertY when they become available. Are t

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Alberto Monteiro
Tom La Bone asked: > > What is the simplest way to specify the location of text in a > scatter plot > (created using the plot function) in relative terms rather than > specific x-y coordinates? For example, rather than putting text at > (300,49) on a plot, how do I put it 1/10 of the way over f

[R] How to Read?

2008-03-12 Thread Monica Pisica
Well, i am not sure what do you want how to do the graphs you showed or how to interpret them?? If you want to know how to do them, look at package ade4, especially functions s.corcircle and scatter.dudi, but you can use the function plot as well and choose the right variables since PCA

Re: [R] Error: arguments imply differing number of rows

2008-03-12 Thread John Kane
Try str() on both objects and see what you get. It does not look like you have two vectors of length=1762. See this for example = aa <- c("A", "B", "D", "D","B", "B","D", "A", "C", "C", "A","D") bb <- rnorm(length(aa)) cc <- matrix(rnorm(length(

[R] Converting a data frame with values into a matrix/

2008-03-12 Thread Srinivas Iyyer
Dear Group, I have a data frame like the following: x <- c("Mike","A",0.01) x1 <- c("Carl","A",0.2) x2 <- c("Gene","C",0.3) x3 <- c("James","A",-0.3) x4 <- c("Dough","B",0) xx <- rbind(x,x1,x2,x3,x4) colnames(xx)<-c("Name","Class","NES") xx <-as.data.frame(xx) > xx Name Class NES x Mike

Re: [R] More digits in prediction using random forest object

2008-03-12 Thread Liaw, Andy
How many trees are you growing in the forest? If you grow a 100-tree forest, the possible predictions (for a two-class data) would simply be {0, 0.01, 0.02, ..., 0.99, 1} Then, of course, if you only grow three trees, the predictions can only be {0, 1/3, 2/3, 1} You can ask for as many digits

Re: [R] SPSS import problem

2008-03-12 Thread Zhao, Wei (Cancer Center)
I had a similar problem when read one of my spss.sav with long variable label. But when I read another spss.sav with short label the same way, I don't have problem. Seems like R only allows variable labels of lengths 1...255 as your error message showed. WZ -Original Message- From: [EMAI

Re: [R] Problem when calling FORTRAN subroutine (dll)

2008-03-12 Thread Berwin A Turlach
G'day Krishna, On Wed, 12 Mar 2008 08:59:30 -0700 (PDT) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > output<-.C("smooth_",as.integer(NROW),as.integer(NCOL),as.integer(NDIM),as.real(X),as.real(W),as.real(A),as.real(B),as.integer(NCYCLE),as.integer(ICYCLE),as.real(G),as.real(EPS),as.integer(I

[R] Problem when calling FORTRAN subroutine (dll)

2008-03-12 Thread [EMAIL PROTECTED]
Hello, I am trying to call a FORTRAN subroutine from R. The Fortran code is @: http://lib.stat.cmu.edu/apstat/206 It performs a bivariate isotonic regression on a rectangular grid (m X n) matrix. I used the g77 compiler and successfully created a dll file and it also loads successfully from R.

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Prof Brian Ripley
See ?par, entry "usr". Either set a new coordinate system and use it, or convert 1/10 to user coordinates. In R-devel (2.7.0 to be) this is easier: text(grconvertX(0.1,"npc"), grconvertY(0.5, "npc"), "some text") cnvrt.coords() in package TeachingDemos does something similar (although it d

Re: [R] Specifying relative position of text in a plot

2008-03-12 Thread Henrique Dallazuanna
Try this: plot(rnorm(100)) text(diff(par("usr")[1:2])/10, sum(par("usr")[3:4])/2, labels="Test") On 12/03/2008, Tom La Bone <[EMAIL PROTECTED]> wrote: > > What is the simplest way to specify the location of text in a scatter plot > (created using the plot function) in relative terms rather tha

Re: [R] [follow-up] "Longitudinal" with binary covariates and outcome

2008-03-12 Thread Charles C. Berry
Ted, What you have can be rendered as a 2^5 (X1 by X2 by X3 by X4 by Y) table of counts, right? Why isn't this a vanilla log-linear modelling (as in loglin() ) problem? It seems to me that the temporal aspect you describe suggests a sequence of margins that could be studied, viz lis

[R] Help in estimating HURST parameter

2008-03-12 Thread Deepak Jadhav
Hi, Can u please tell me which all packages do i need to install to estimate the hurst parameter in R. I have tried installing all the possible options but still it doesnt work. basically i want to use 9 functions to estimate hurst parameter like aggvarfit, rsfit, etc. i will be very thankfu

Re: [R] ftable and xtabs

2008-03-12 Thread Henrique Dallazuanna
Please see the footer of email: > 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. try this cbind(write.ftable(

[R] [follow-up] "Longitudinal" with binary covariates and outcome

2008-03-12 Thread Ted Harding
Hi again! Following up my previous posting below (to which no response as yet), I have located a report which situates this type of question in a longitudinal modelling context. http://www4.stat.ncsu.edu/~dzhang2/paper/glm.ps Generalized Linear Models with Longitudinal Covariates Daowen Zhang & Xi

[R] Specifying relative position of text in a plot

2008-03-12 Thread Tom La Bone
What is the simplest way to specify the location of text in a scatter plot (created using the plot function) in relative terms rather than specific x-y coordinates? For example, rather than putting text at (300,49) on a plot, how do I put it 1/10 of the way over from the y axis and 1/2 of the way

Re: [R] hello! i need help for a specific graphic issue

2008-03-12 Thread bartjoosen
quick (and dirty) solution: y.up<- means+stand.error y.dwn<- means-stand.error plot(means,ylim=c(3.5,10)) for (i in 1:length(means)) arrows(i,means[i],i,y.up[i],length=0.1) for (i in 1:length(means)) arrows(i,means[i],i,y.dwn[i],length=0.1) Giacomo Prodi wrote: > > hello, ladyes and gentlem

Re: [R] hello! i need help for a specific graphic issue

2008-03-12 Thread John Kane
I don't think that you're actually creating a scatterplot if the x-axis is a factor. You're getting a boxplot. If you want a scatterplot then something like this might work. == means<-c(4,6,8) stand.error<-c(0.1,0.3,0.5) aa <- factor(c("A","B"

Re: [R] hello! i need help for a specific graphic issue

2008-03-12 Thread hadley wickham
On Wed, Mar 12, 2008 at 5:37 AM, Giacomo Prodi <[EMAIL PROTECTED]> wrote: > hello, ladyes and gentlemans. > > check this: > > means<-c(4,6,8) > stand.error<-c(0.1,0.3,0.5) > > now i've strongly tryed to scatterplot the > means(y-axis),by showing their sd with the > arrow(..,code=3,angle=90) f

[R] ftable and xtabs

2008-03-12 Thread Amnon Melzer
Hoping someone can help me with xtabs and ftable. I'm trying to get a pair of ftables (possibly more) next to each other. For example: > dunhill_lights_xtab<-ftable(xtabs(grossedupobs ~ gender+age_group + dunhill_lights, data = ciggs)) > dunhill_lights_xtab dunhill_lights

[R] Spatially Lagged Predictor Variable Models

2008-03-12 Thread ArunPrasad
Hi Everyone, I am doing a project based on "Spatially Lagged Predictor Variable Models", I would like to know which package in R would execute this model. Also, I am new to this field of spatial statistics. Any suggestions for a good book on spatial regression analysis would be apprec

[R] error window

2008-03-12 Thread Klemens Vierlinger
Hi, I guess this problem is super-trivial but I dont even know where to start looking. After I installed R on my new computer, R has a strange new feature. It shows any error messages not only on the promt (as usual), but also in a little pop up window which I need to click away before I can pro

Re: [R] Error opening SHP file (maptools)

2008-03-12 Thread Roger Bivand
Don MacQueen llnl.gov> writes: > > The help page for readShapePoints says that the file name that you > supply should not include the extension. > > The "system.file" part of the example in the help page is only to use > the example file that came with the package. Since you want to open > y

Re: [R] hello! i need help for a specific graphic issue

2008-03-12 Thread René Capell
hi Giacomo, consider this: means<-c(4,6,8) stand.error<-c(0.1,0.3,0.5) lowlim<-means-stand.error uplim<-means+stand.error plot(as.factor(c("a","b","c")),means,ylim=c(min(lowlim),max(uplim))) arrows(c(1:3),lowlim,c(1:3),uplim,code=3,angle=90) Still, its just a workaround and I don't think you can

Re: [R] Mimicking SPSS weighted least squares

2008-03-12 Thread John Fox
Dear Peter, Actually, I'm aware of these distinctions. In my experience, identical replicates are relatively rare, but do occur, e.g., when one inputs a contingency table from a secondary source. On the other hand, I can't count the times (including two days ago) that I've seen people do the fo

[R] constrained optimisation

2008-03-12 Thread giovanna menardi
Hi, i have to optimise a function f(a,b), with a, b vectors in R^d such that a and b are orthogonal, that is a'b=0. Anybody has a suggestion? Thanks, in advance, for your help, Giovanna _ [[elided Hotmail spam]] [[alte

Re: [R] Graphing question (multiple line graphs arranged spatially)

2008-03-12 Thread Jim Lemon
stephen sefick wrote: station month bas 190 5 0.000 190 7 1.563 190 10 0.000 190 11 0.000 202 4 18.750 202 5 18.750 202 7 6.250 202 10 4.800 202 11 3.125 198 4 18.750 198 5 31.250 198 7

[R] hello! i need help for a specific graphic issue

2008-03-12 Thread Giacomo Prodi
hello, ladyes and gentlemans. check this: means<-c(4,6,8) stand.error<-c(0.1,0.3,0.5) now i've strongly tryed to scatterplot the means(y-axis),by showing their sd with the arrow(..,code=3,angle=90) function. The problem is that my x-axis has categorical values (say, factor(x)), and the arrows()

Re: [R] persp question

2008-03-12 Thread Duncan Murdoch
On 11/03/2008 2:40 PM, [EMAIL PROTECTED] wrote: > someone sent in a question earlier about doing > something in 3D so i took a stab at it purely > for educational purposes ( i'm not even sure that I understood the question > actually ). > > Unfortunately, persp gives me an error that I don't un

Re: [R] internet proxy settings (win)

2008-03-12 Thread Thomas Steiner
Thanks Liviu, I am trying out what is proposed in the mentioned thread. I start R by "C:\Program Files\R\R-2.6.2\bin\Rgui.exe" http_proxy="http://proxy.haifis.org:8080"; Then I do the following (selecting "Austria" as mirror) > install.packages("package", method="wget") --- Please select a CRAN

Re: [R] Trellis plots with two regression lines

2008-03-12 Thread yvo
Thanks a lot Thierry and Frede!!! Thats great- I made it much more complicated!!! -- View this message in context: http://www.nabble.com/Trellis-plots-with-two-regression-lines-tp15976467p16000637.html Sent from the R help mailing list archive at Nabble.com.

[R] odfWeave examples not working

2008-03-12 Thread bartjoosen
Hi, I'm currently taking a look at possibilities to report my results, produced by R. After looking at LaTex, I'm now considering the odf format, as most people at my company work with MS Word. So using odfWeave would be my best bet probably. But if I run some examples from the odfWeave package,

Re: [R] Trellis plots with two regression lines

2008-03-12 Thread Frede Aakmann Tøgersen
Try xyplot(abund ~ bif | experiment, data=graphs, groups=stage, type = c("p", "r")) See the help page for panel.xyplot(). Best regards Frede Aakmann Tøgersen Scientist UNIVERSITY OF AARHUS Faculty of Agricultural Sciences Dept. of Genetics and Biotechnology Blichers Allé 20, P.O. B

Re: [R] SPSS import problem

2008-03-12 Thread Prof Brian Ripley
We need to be able to reproduce this, so can you please make the file available? Please follow up to R-devel. On Wed, 12 Mar 2008, K. Elo wrote: > Dear all, > > I have tried to import a SPSS file in R, but always get the following > message: > --- cut here --- > Error in read.spss("spss-data.sa

Re: [R] how to let R support Chinese fonts in charts?

2008-03-12 Thread Prof Brian Ripley
You need to tell us your OS: see the request in the posting guide for 'at a minimum' the result of sessionInfo(). We also need to know what graphics device(s) you are intending to use. For postscript or PDF, see the article by Paul Murrell and myself in R News 2006-2. Note too that 'Chinese'

[R] how to let R support Chinese fonts in charts?

2008-03-12 Thread Samuel
Hi everyone, I plotted a chart this morning, which should have Chinese lables for the points. I made the chart via: coordinates: angel77wq360.615019.278135 cngdsthuang1220 -278.74068 91.556843 c国际米兰c 125.47369 -66.589461 fszym2007 -174.86150 346.672588 john_azyb_lee

Re: [R] gracefully handing a library load error

2008-03-12 Thread Prof Brian Ripley
This is not a graceful error, and it needs to be corrected by the package (not 'library') maintainer. R's own devices which need X11 do fail gracefully if the session is headless. Meanwhile, there are other graphics devices which create SVGs and do not do this. E.g. R-devel (to be 2.7.0) has

[R] SPSS import problem

2008-03-12 Thread K. Elo
Dear all, I have tried to import a SPSS file in R, but always get the following message: --- cut here --- Error in read.spss("spss-data.sav", : error reading system-file header In addition: Warning message: In read.spss("spss-data.sav", : spss-data.sav: Variable Y6B_A indicates variable la