Re: [R] Replace with something else

2012-11-18 Thread arun
Hi, x1<-read.table(text="  Year   AP  EU  LA  NA total Jun2012 2.32 2.26 5.38 13.74 23.70 Jul2012 2.46 2.21 5.33 12.94 22.94 Aug2012 2.69 2.24 5.28 13.32 23.54 Sep2012 2.62 2.28 5.14 12.99 23.06 Oct2012 2.61 2.27 5.31 12.59 22.80 Nov2012 2.55 2.18 5.08 12.56 22.39 ",sep="",stringsAsFactors=FALS

[R] loop to subtract arrays / error

2012-11-18 Thread iembry
Hi everyone, I am having trouble with creating a loop to subtract arrays. In R, this is what I have done: > Vobsr <- read.csv("Observed_Flow.csv", header = TRUE, sep =",") # see data > below > Vsimr <- read.csv("1000Samples_Vsim.csv", header = TRUE, sep =",") # see > data below > Vobsr <- as.matr

[R] glht function in multcomp gives unexpected p=1 for all comparisons

2012-11-18 Thread Katie Boothroyd-Roberts
Hi, I have data with binomial response variable (survival) and 2 categorical independent variables (site and treatment) (see below).  I have run a binomial GLM and found that both IVs and the interaction are significant.  Now I want to do a post-hoc test for all pairwise comparisons to see whi

Re: [R] R-Square in WLS

2012-11-18 Thread peter dalgaard
On Nov 18, 2012, at 21:32 , Thomas Lumley wrote: > On Fri, Nov 16, 2012 at 4:48 PM, frespider wrote: > >> Hi, >> >> I am fitting a weighted least square regression and trying to compute >> SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know >> what I am coding wrong. Can y

Re: [R] Sum Column in data.frame for Excel-Export

2012-11-18 Thread PIKAL Petr
Hi maybe ?rbind Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Mat > Sent: Friday, November 16, 2012 3:42 PM > To: r-help@r-project.org > Subject: [R] Sum Column in data.frame for Excel-Export > > Hello together, >

Re: [R] about lm

2012-11-18 Thread PIKAL Petr
Hi Values ve or su came as factors during the input. Probably some mismatch in decimal point, nonumeric value somewhere, thousands separator or something else. At least str(mat) can help you (and us) what is the problem. Regards Petr > -Original Message- > From: r-help-boun...@r-projec

Re: [R] Basic Stats question

2012-11-18 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Jeff Newmiller > Sent: Saturday, November 17, 2012 3:21 PM > To: Partha Sinha; r-help@r-project.org > Subject: Re: [R] Basic Stats question > > If you read the posting guide

Re: [R] ggplot2: "varwidth"-equivalent for geom_boxplot?

2012-11-18 Thread Hadley Wickham
> I'd like to resurrect this issue: is the "varwidth" equivalent (boxplot > box-width scaling according to number of data points) emulatable in the > 0.9.* versions of ggplot2? Width still doesn't seem capable of accepting a > vector with length > 1 ... No, and it's not currently on the to do list

Re: [R] [lattice] format and rotation of strip text

2012-11-18 Thread David Winsemius
On Nov 18, 2012, at 7:05 PM, Tom Roche wrote: https://stat.ethz.ch/pipermail/r-help/2012-November/329479.html Hopefully [sufficiently] "small, self-contained example": mailquotes omitted from "start example" to "end example" to ease rerunning the following code: # start example library(res

Re: [R] Error in `[.data.frame`... undefined columns selected

2012-11-18 Thread David Winsemius
On Nov 18, 2012, at 6:34 PM, Eiko Fried wrote: When I run this script on 9 variables, it works without problems. Z <- data [,c ("s1_1234_m ","s2_1234_m ","s3_1234_m ","s4_1234_m ","s5_1234_m","s6_1234_m","s7_1234_m","s8_1234_m","s9_1234_m" )] However, when I run the script on 9 different vari

Re: [R] How to fix it?

2012-11-18 Thread Thomas Lumley
On Mon, Nov 19, 2012 at 10:31 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > On Sunday, November 18, 2012, Rlotus wrote: > > > Gives a mistake that "probability" is not found > > > > x<- runif(1,0,1) > > y<-x^5+x^8+(cos(x))^3 > > yrandom<- runif(10,0,3) > > if (y > area=probability

Re: [R] [lattice] format and rotation of strip text

2012-11-18 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-November/329479.html >> Hopefully [sufficiently] "small, self-contained example": mailquotes omitted from "start example" to "end example" to ease rerunning the following code: # start example library(reshape2) library(lattice) lon=11 lat=7 lev=5 len=l

[R] Error in `[.data.frame`... undefined columns selected

2012-11-18 Thread Eiko Fried
When I run this script on 9 variables, it works without problems. Z <- data[,c("s1_1234_m","s2_1234_m","s3_1234_m","s4_1234_m","s5_1234_m","s6_1234_m","s7_1234_m","s8_1234_m","s9_1234_m" )] However, when I run the script on 9 different variables, it does not work: Z <- data[,c("d_s1_m","d_s2_m","

Re: [R] (no subject)

2012-11-18 Thread Dimitri Liakhovitski
Sorry, got the answer (ticktype): persp(x, y, z1,box = TRUE, axes = TRUE,ticktype="detailed") Thanks! D. On Sun, Nov 18, 2012 at 8:20 PM, Dimitri Liakhovitski < dimitri.liakhovit...@gmail.com> wrote: > Dear R-ers, > > I have 3 vectors - x, y, and z and want to plot a surface (z as the 3rd > di

Re: [R] [lattice] format and rotation of strip text

2012-11-18 Thread David Winsemius
On Nov 18, 2012, at 12:42 PM, Tom Roche wrote: Thanks to the lattice gurus on this list, and having reference to the excellent open-access Sarkar 2008 ISBN 978-0-387-75968-5 e-ISBN 978-0-387-75969-2 http://dx.doi.org/10.1007/978-0-387-75969-2 I now know how to label lattice panels by variabl

Re: [R] Best prediction to use to use for basic problem?

2012-11-18 Thread Bert Gunter
1. This is not really an R question. I suggest you post to a statistical list like stats.stackexchange.com instead. 2. I also suggest you consult a local statistician. You have a time series with a categorical response. That's not so simple as you think (and folks on stackexchange may provide you

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread bgreen
Hello David, Many thanks - this does exactly what I want and it lets me see whether the clusters make sense in terms of the patetrn of values & where they join a cluster. Regards Bob > Something like this? > >> split(FS1, hcli8) > $`1` >X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 > 1 1 1 0

Re: [R] Replace with something else

2012-11-18 Thread p_connolly
Try x1$`NA` instead of x1$NA. HTH Quoting eric : I inserted na.strings='' and that seemed to work except for a problem with a plot statement plot(x1$NA,type='l',ylab='M kg/ y ',xlab='') Error: unexpected numeric constant in "plot(x1$NA" tail(x1) AP EU LANA total Jun 20

Re: [R] additive interaction for a dichotomous dependent variable (i.e. risk difference)

2012-11-18 Thread Frank Harrell
In many situations the interactions indicated by additive risk models are false in the sense that they merely reflect restrictions so that risk are in [0,1]. I tend to prefer models that have no restrictions on the parameters. In fact, I think that a test of goodness of fit of a model can be made

Re: [R] Replace with something else

2012-11-18 Thread eric
I inserted na.strings='' and that seemed to work except for a problem with a plot statement plot(x1$NA,type='l',ylab='M kg/ y ',xlab='') Error: unexpected numeric constant in "plot(x1$NA" > tail(x1) AP EU LANA total Jun 2012 2.32 2.26 5.38 13.74 23.70 Jul 2012 2.46 2.21 5.33 1

Re: [R] R-Square in WLS

2012-11-18 Thread frespider
Hi Thomas, Can you please edit my code in way it works. I appericated your help. I need to calculate the R2 in the Z scale and it is not make sense to me. or Can I have some documentation to read? Thanks Date: Sun, 18 Nov 2012 12:35:03 -0800 From: ml-node+s789695n4649969...@n4.nabble.com To

Re: [R] Question about making histogram and x must be numeric

2012-11-18 Thread David L Carlson
You tried setting shorter variable names, but the two lines of your data set that you gave us still have the original names, eg. Telephone.lines..per.100.people. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station,

Re: [R] Question about making histogram and x must be numeric

2012-11-18 Thread jim holtman
Most likely the value you are using in the 'hist' function is a factor. It would help if you included an 'str' of the object you are using. On Sun, Nov 18, 2012 at 4:45 PM, 9man wrote: > Hello all, > > I hope someone of you can help me out, I have searched other posts as well > but I can't find

Re: [R] list.files, recursively

2012-11-18 Thread jim holtman
You can do the following to remove the directory names from the list: setdiff(list.files(full.names = TRUE), list.dirs(recursive = FALSE)) On Sun, Nov 18, 2012 at 12:20 PM, Jannis wrote: > Dear R developers, > > > as far as I understand the manual of list.files(), there is only a way to > excl

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread David L Carlson
Something like this? > split(FS1, hcli8) $`1` X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 1 1 1 0 1 0 0 1 1 0 1 1 1 3 1 0 1 0 0 1 1 0 0 1 0 1 4 1 1 0 0 0 0 1 1 1 1 1 1 7 0 1 0 1 0 0 1 1 0 1 0 1 9 1 1 1 1 0 1 1 0 1 1 1 0

[R] Question about making histogram and x must be numeric

2012-11-18 Thread 9man
Hello all, I hope someone of you can help me out, I have searched other posts as well but I can't find any solution to the problem I'm dealing with. I want to make a histogram from the data Telephone Lines MDGdataset <-read.csv("MDG_dataset_2010.csv", header=T) MDGdatasetAdapted <- subset(MDGdat

Re: [R] Replace with something else

2012-11-18 Thread arun
Hi, Try this: If you wanted to replace "<" and ">" from NA: dat1<-read.table(text=" 635    LA 201207  557329 636    LA 201208  683771 637    LA 201209  613851 638    LA 201210  764217 639    LA 201211  212897 782  200701  875634 783  200702  614856 784  200703  521520 785  200704 1406400 ",sep=

Re: [R] Replace with something else

2012-11-18 Thread jim holtman
use na.strings = '' > x <- read.table(text = "635 LA 201207 557329 + 636 LA 201208 683771 + 637 LA 201209 613851 + 638 LA 201210 764217 + 639 LA 201211 212897 + 782 NA 200701 875634 + 783 NA 200702 614856 + 784 NA 200703 521520 + 785 NA 200704 1406400", as.is

Re: [R] Decimal places

2012-11-18 Thread R. Michael Weylandt
On Sunday, November 18, 2012, Rlotus wrote: > I am a beginner in programmin in general and R specifically. > > I would like to generate a set of random numbers in a normal distribution > but to limit the decimal places in these numbers to only 2. > > I have been using x1 <- runif(1,0,1) to generat

Re: [R] identical matrices

2012-11-18 Thread R. Michael Weylandt
Please stop posting and re-posting the same questions. Michael On Sunday, November 18, 2012, Haris Rhrlp wrote: > Dear R users, > > > I want to check matrices when i change the order of the rows or/and the > order of the columns or/and the combination of them > > i will give an example what i wa

Re: [R] How to fix it?

2012-11-18 Thread R. Michael Weylandt
On Sunday, November 18, 2012, Rlotus wrote: > Gives a mistake that "probability" is not found > > x<- runif(1,0,1) > y<-x^5+x^8+(cos(x))^3 > yrandom<- runif(10,0,3) > if (y area=probability*3 > > You're ignoring the warning that's also given. Read ?ifelse and be enlightened Cheers Michael > >

[R] Decimal places

2012-11-18 Thread Rlotus
I am a beginner in programmin in general and R specifically. I would like to generate a set of random numbers in a normal distribution but to limit the decimal places in these numbers to only 2. I have been using x1 <- runif(1,0,1) to generate my numbers. Can I add something to it to enable me t

[R] Replace with something else

2012-11-18 Thread eric
I am reading some data into R from an Excel spreadsheet using read.csv. Some of the original data that comes into column 1 from the spreadsheet is text that says NA. The NA stands for north america. As it comes in, R converts the NA over to . What is the cleanest way to change the values to so

[R] subtract multiple columns from single column for Nash Sutcliffe efficiency

2012-11-18 Thread iembry
Hi everyone, I am having trouble using my own data in the Nash-Sutcliffe efficiency (NSE) function. In R, this is what I have done: Vobsr <- read.csv("Observed_Flow.csv", header = TRUE, sep =",") # see data below Vsimr <- read.csv("1000Samples_Vsim.csv", header = TRUE, sep =",") # see data below

[R] How to fix it?

2012-11-18 Thread Rlotus
Gives a mistake that "probability" is not found x<- runif(1,0,1) y<-x^5+x^8+(cos(x))^3 yrandom<- runif(10,0,3) if (yhttp://r.789695.n4.nabble.com/How-to-fix-it-tp4649955.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.

[R] Best prediction to use to use for basic problem?

2012-11-18 Thread Brian Feeny
I have a rather basic set of data. It is simply a variable that can be 0, 1 or 2 and its value over a series of time t0 - t9 like so: y: 1 1 2 0 1 2 2 1 2 1 x: t0 t1 t2 t3 t4 t5 t6 t7 t8

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread Bob Green
David, Many thanks, I'm sure this will be helpful. What would also be helpful is if I can extract each cluster and examine id by variable, within the respective cluster. I could index the variables for each cluster and run such an analysis but thre must be a more efficient way of doing this

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-November/329450.html >> I [can now] prepare my netCDF data specifying gas concentrations over >> a 3D space (dimensions longitude, latitude, and (vertical) level), >> so as to call lattice::levelplot() like >> levelplot(conc ~ lon * lat | lev, data=data.

[R] identical matrices

2012-11-18 Thread Haris Rhrlp
Dear R users, I want to check matrices when i change the order of the rows or/and the order of the columns or/and the combination of them i will give an example what i want  1  -1  1  1  1  1   1  1 -1  -1 -1 -1    -1 -1  -1  -1   1  1    1  1 1 -1    1   1 these 2 matrices are iden

Re: [R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread David L Carlson
If you just want a summary of the mean for each variable in each cluster, this will get you there: > set.seed=42 > FS1 <- data.frame(matrix(sample(c(0, 1), 12*63, replace=TRUE), nrow=63, + ncol=12)) > dmat <- dist(FS1, method="binary") > cl.test <- hclust(dmat, method="average") > plot(cl.test, h

[R] [lattice] format and rotation of strip text

2012-11-18 Thread Tom Roche
Thanks to the lattice gurus on this list, and having reference to the excellent open-access Sarkar 2008 ISBN 978-0-387-75968-5 e-ISBN 978-0-387-75969-2 http://dx.doi.org/10.1007/978-0-387-75969-2 I now know how to label lattice panels by variable value: see thread starting @ https://stat.ethz.c

Re: [R] R-Square in WLS

2012-11-18 Thread Thomas Lumley
On Fri, Nov 16, 2012 at 4:48 PM, frespider wrote: > Hi, > > I am fitting a weighted least square regression and trying to compute > SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know > what I am coding wrong. Can you help please? > For a start, you need to replace your mu

Re: [R] i want to put the results of the list in a for loop

2012-11-18 Thread arun
HI, Not sure if I understand it clearly. Are you looking for something like this: res1<-list()  fun1<-function(x,res){  for(i in 1:ncol(x)){  res[[i]]<-list()  res[[i]]<-combn(1:ncol(x),i)  }  res} fun1(m1,res1) [[1]] [,1] [,2] [,3] [,4] [,5] [1,]    1    2    3    4    5 [[2]] [,1]

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Bert Gunter
OK -- to answer my own question below, here's how to compute them on the fly, which may be a better answer than what I gave in my earlier reply to Tom Roche: x <- 1:10; y <- runif(10); f <- factor(rep(1:2,5)) xyplot(y~x|f, strip=function(which.panel,factor.levels,...){ lab <- level

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Bert Gunter
I looked at strip.custom()'s code and now get it, too. Here's the version for that: xyplot(y~x|f, strip=strip.custom(factor.levels=c("a","b"),style=1)) Both of these require precomputing the factor.levels vector of character (or expression) labels. I see no obvious way to calculate them on the f

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Bert Gunter
Ken: Aha! Thank you. I was thrown by the phrase in the Help file, "currently being drawn," which I parsed to the levels rather the conditioning variable. As I suspected, user error! Still not sure why strip.custom fails. -- Bert On Sun, Nov 18, 2012 at 10:25 AM, Ken Knoblauch wrote: > Bert,

Re: [R] additive interaction for a dichotomous dependent variable (i.e. risk difference)

2012-11-18 Thread Uwe Ligges
On 16.11.2012 02:39, sarahw wrote: Did you ever get a response to this or resolve this yourself? You sent a message to the mailing list, but apparently not to the original poster. Uwe Ligges Many thanks! -- View this message in context: http://r.789695.n4.nabble.com/additive-inter

Re: [R] discrete discriminant analysis

2012-11-18 Thread Uwe Ligges
On 16.11.2012 16:05, Catarina Maia wrote: Hello, I am using the mda package and in particular the fda routine to classify in term of gear a set of 20 trips. I preformed a flexible discriminant analysis (FDA) using a set of 151 trips. FDAT1 <- fda(as.factor(gear) ~ . , data =matrizR) A t

Re: [R] vectorized plotmath expressions via substitute()

2012-11-18 Thread Uwe Ligges
On 15.11.2012 10:52, Gabor Grothendieck wrote: On Wed, Nov 14, 2012 at 12:05 PM, Murat Tasan wrote: hi all - i've seen versions of this question before, but none seem to get directly at my solving my (probably very simple) issue: i simply want to annotate the tick marks on an axis with (supe

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Ken Knoblauch
Bert, A little bit of experimentation and I got this: library(lattice) x <- 1:10 y <- runif(1:10) f <- factor(rep(1:2,5)) xyplot(y ~ x | f,  strip = function(which.panel, factor.levels,...){       lab <- c("a","b") #[which.panel]       strip.default(factor.levels = lab,

Re: [R] tol in prcomp

2012-11-18 Thread Uwe Ligges
On 17.11.2012 00:41, nmend wrote: Hi there, I was wondering if anyone could explain how you should set tol in the prcomp function. Using help(prcomp) explains it as "a value indicating the magnitude below which components should be omitted. (Components are omitted if their standard deviations

[R] i want to put the results of the list in a for loop

2012-11-18 Thread Haris Rhrlp
Dear R users, i want to put the results of a list to a for loop. i will give an example m1<-matrix(rep(1,15),ncol=5)   ind.sgn <- lapply(1:ncol(m1), combn, x = ncol(m1))  ind.sgn [[1]] [,1] [,2] [,3] [,4] [,5] [1,]    1    2    3    4    5 [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]

Re: [R] area under the curve

2012-11-18 Thread Uwe Ligges
On 18.11.2012 18:37, Rlotus wrote: I have function y=x^5+x^8+ (cos(x))^3; I need to get random x; random y; and after that determine whether y below or above the given function. I tried a lot of version. but my code even doesnt workplz help with this expressions ;( I am a begiiner in R

Re: [R] area under the curve

2012-11-18 Thread Uwe Ligges
Which message are you referring to? Please quote. And please read the posting guide to the mailing list that asks you to do that! On 18.11.2012 18:55, Rlotus wrote: I mean i need to put random x in equation in order to determine value y. i used runifbut it doesn work... y= (runif(0,1))^

Re: [R] Fill in a pdf with colour

2012-11-18 Thread Uwe Ligges
On 18.11.2012 13:02, nany23 wrote: Good morning, I have a sampled probability density function and I have to fill in with colour a fraction of the total area beneath the curve (e.g. the 50% of the total area beneath the curve). I would like to know which is the simplest way to do this. See ?

Re: [R] Import excel file

2012-11-18 Thread Uwe Ligges
On 16.11.2012 16:59, Rui Barradas wrote: Hello, I believe it is, but see package XLConnect. The vignette is very helpfull, with lots of examples. ... and many other ways. Please see the manual "R Data Import/Excel" that ships with R and has a whole section devoted to Excel. Best, Uwe Ligg

Re: [R] list.files, recursively

2012-11-18 Thread Rui Barradas
Hello, I believe that's a question for r-devel, but good point. It's docummented that in non-recursive calls to list.files subdirectory names are always included. (With a typo, "There always are" instead of "They always are".) Rui Barradas Em 18-11-2012 17:20, Jannis escreveu: Dear R develo

Re: [R] area under the curve

2012-11-18 Thread Rlotus
I mean i need to put random x in equation in order to determine value y. i used runifbut it doesn work... y= (runif(0,1))^5+(runif(0,1))^8+((cos runif(0,1)))^3; (<=it doesnt work properly) now i have value y need to determine whether y is above or below my function. so after that y1=r

Re: [R] centroid of hclust

2012-11-18 Thread Uwe Ligges
On 18.11.2012 14:25, eliza botto wrote: Dear UseRs,i want to find centroid of clusters, which i generated by hclust. Is there a way doing that? i took mean to elements in each cluster to get centroid but i am not sure if i am right? Yes, that is a common definition for centroid. Uwe Ligge

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Bert Gunter
Ken: I would have thought so, too. However: x <- 1:10; y <- runif(1:10); f <- factor(rep(1:2,5)) xyplot(y~x|f, strip= function(which.panel,factor.levels,...){ lab <- c("a","b")[which.panel] strip.default(factor.levels=lab,which.panel=which.panel,style=1,...)} ) produces label "a" fo

[R] Fill in a pdf with colour

2012-11-18 Thread nany23
Good morning, I have a sampled probability density function and I have to fill in with colour a fraction of the total area beneath the curve (e.g. the 50% of the total area beneath the curve). I would like to know which is the simplest way to do this. Thank you for answering Best regards Nany23

[R] area under the curve

2012-11-18 Thread Rlotus
I have function y=x^5+x^8+ (cos(x))^3; I need to get random x; random y; and after that determine whether y below or above the given function. I tried a lot of version. but my code even doesnt workplz help with this expressions ;( I am a begiiner in R -- View this message in context: http:

[R] list.files, recursively

2012-11-18 Thread Jannis
Dear R developers, as far as I understand the manual of list.files(), there is only a way to exclude directories from the returned vector if you use list.files recursively. In non recursive mode, there seems to be no way of excluding directories (the include dirs argument does not seem to hav

Re: [R] manipulating longitudinal data in r

2012-11-18 Thread Jeff Newmiller
Michael, this comment doesn't seem appropriate to the question, since the sample data is a ragged array that requires the addition of NAs to fit into a wide format. --- Jeff NewmillerThe .

Re: [R] polycor package

2012-11-18 Thread yrosseel
The reason I was working with a correlation matrix is because I wanted to calculate polychoric correlations first before submitting it to the actual sem command. I was unsure whether R would use polychoric correlations when indicating which of the variables are ordered. A final question on the sam

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Ken Knoblauch
Tom Roche pobox.com> writes: > > > As described @ <<< clipped >>> > > However I will need to before-and-after compare this to the results of a > reboxing, or 3D regridding, of this data, so I would prefer instead to > label each panel in the lattice with the _value_ of the level (an > atm

Re: [R] manipulating longitudinal data in r

2012-11-18 Thread Michael Dewey
At 08:56 17/11/2012, Kemi Racheal wrote: Dear list member, I have the following data example ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1,1,2)) I want to add another variable b, such that the max of 'a' by id is returned i.e data ke becomes ke <- data.frame(patid=c(1,1,1,2,3,3),a=c(1,2,2,1

Re: [R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Bert Gunter
AFAICS, you will have to pre-compute the values and create a factor with levels these values as character strings. Then use this factor as the conditioning variable ?sprintf ?formatC ?round and the like may be useful to format the numerical values suitably for your labels. Cheers, Bert On Sun,

Re: [R] polycor package

2012-11-18 Thread Laura Maria Schwirz
Dear Yves Many thanks for your quick reply, I really appreciate it! The reason I was working with a correlation matrix is because I wanted to calculate polychoric correlations first before submitting it to the actual sem command. I was unsure whether R would use polychoric correlations when indic

[R] [lattice] how to label panels with variable value (not name)?

2012-11-18 Thread Tom Roche
As described @ https://stat.ethz.ch/pipermail/r-help/2012-November/329442.html I now know how to prepare my netCDF data specifying gas concentrations over a 3D space (dimensions longitude, latitude, and (vertical) level), so as to call lattice::levelplot() like levelplot(conc ~ lon * lat | lev,

[R] centroid of hclust

2012-11-18 Thread eliza botto
Dear UseRs,i want to find centroid of clusters, which i generated by hclust. Is there a way doing that? i took mean to elements in each cluster to get centroid but i am not sure if i am right? thanks in advanceeliza [[alternative HTML version deleted]]

Re: [R] ggplot2: "varwidth"-equivalent for geom_boxplot?

2012-11-18 Thread Johannes Graumann
Hello, I'd like to resurrect this issue: is the "varwidth" equivalent (boxplot box-width scaling according to number of data points) emulatable in the 0.9.* versions of ggplot2? Width still doesn't seem capable of accepting a vector with length > 1 ... Thank you for your input. Sincerely, Joh

Re: [R] help interpreting dudi.pco

2012-11-18 Thread Brian Feeny
I am new to R as well, it sounds like you would want to look at clustering, perhaps k-means clustering. Brian On Nov 18, 2012, at 12:19 AM, avadhoot velankar wrote: > I am working on morphometry of hairs and want to see if selected variables > are giving significantly distinct groups. > > I

[R] Examining how cases are similar by cluster, in cluster analysis

2012-11-18 Thread Bob Green
Hello, I used the following code to perform a cluster analysis on a dataframe consisting of 12 variables (coded as 1,0) and 63 cases. FS1 <- read.csv("D://Arsontest2.csv",header=T,row.names=1) str(FS1) dmat <- dist(FS1, method="binary") cl.test <- hclust (dist(FS1, method ="binary"), "av

Re: [R] ggplot2:

2012-11-18 Thread Johannes
> Hello, I'd like to resurrect this issue: is the "varwidth" equivalent (boxplot box-width scaling according to number of data points) emulatable in the 0.9.* versions of ggplot2? Width still doesn't seem capable of accepting a vector with length > 1 ... Thank you for your input. Sincerely, J