Re: [R] nls() and lines()

2011-07-18 Thread Peter Ehlers
s, but here's what you posted as your 'last line of code': lines(modb, predict(nls.2009, lines(as.numeric(x)=modb))) Perhaps just a typo: lines -> list??? In any case, the newdata in predict should have a variable 'Year'. Peter Ehlers I've been using this code

Re: [R] nls() and lines()

2011-07-18 Thread Peter Ehlers
nk that lines(as.numeric(x)=modb) would qualify as newdata. It's usually a bad idea to shove too much stuff into a single command and a good idea to use str() often. This 'exact' code worked in the past? Peter Ehlers The model is fine, but it's the plotting of the mo

Re: [R] plot means ?

2011-07-12 Thread Peter Ehlers
On 2011-07-12 07:03, Sam Steingold wrote: [snip] the totally unnecessary semi-colons) then why are they accepted? optional syntax elements suck... They're accepted because they *can* be useful (multiple statements on one line). Is there *any* language that can *not* be abused?

Re: [R] change legend character size in image.plot

2011-07-10 Thread Peter Ehlers
, then you should provide a reproducible example that illustrates the problem. Peter Ehlers Regards, Dieter -- View this message in context: http://r.789695.n4.nabble.com/change-legend-character-size-in-image-plot-tp3657423p3657423.html Sent from the R help mailing l

Re: [R] Error "singular gradient matrix at initial parameter estimates" in nls

2011-06-30 Thread Peter Ehlers
uld be very much appreciated. I don't know anything about a Brice-Model, but I doubt that you have it right. 4*pi*390*Na is about 3*10^27 and that doesn't seem right to me. In addition, do put your data into a data.frame (containing variables r and D) and learn to use dput for post

Re: [R] 4D data acsess

2011-06-30 Thread Peter Ehlers
NULL. Katia probably just needs to do do two things: 1. extract array X from list X (e.g. with X <- X$X). 2. learn to read the documentation of functions she's trying to use. Peter Ehlers Y<- X dim(Y)<- c(64,64,21,300) Y[ 1, 1, 1, ] -- View this message in context: http

Re: [R] means and error bars on xyplot for binary data

2011-06-28 Thread Peter Ehlers
l.xYplot mn <- with(bin.data, tapply(y, x, mean)) M <- Cbind(mn, lower = mn - .1, upper = mn + .1) ## NB: capital 'C' stripplot(jitter(y, factor =.6) ~ x, data = bin.data, ylab = "", panel = function(...) { panel.stripplot(..., jitter=TRUE, factor

Re: [R] how to print "<=" in plot title

2011-06-28 Thread Peter Ehlers
0) title(bquote( x %<=% .(x) )) ?plotmath Peter Ehlers Thanks John __ 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 co

Re: [R] extracting data

2011-06-28 Thread Peter Ehlers
st" m.out.base<- matchit(formula=f, data=A, method=m) B<- match.data(m.out.base) An<- nrow(A) Bn<- nrow(B) Cn<- An - Bn C<- ?? Can't you just use idx <- setdiff(rownames(A), rownames(B)) C <- A[idx, ] Peter Ehlers From

Re: [R] R PLS package data format

2011-06-27 Thread Peter Ehlers
ta frame a matrix? Just like the test data ¡§gasoline¡¨ in your PLS package: library(pls) data(yarn) is.vector(density) returns TRUE is.matrix(NIR) returns TURE (NIR is a matrix) This is all perfectly well described in ?data.frame where you will also find reference to the use of I() to accompli

Re: [R] Only one strip with italic font.

2011-06-26 Thread Peter Ehlers
logCFU ~ t | microorg + tratam, strip = function(..., which.given, par.strip.text) strip.default(..., which.given = which.given, par.strip.text = list( font = myfonts[which.given]))) Peter Ehlers Thank you for your help. Kenn

Re: [R] integration function

2011-06-26 Thread Peter Ehlers
egrand <- function (x, mu){ to {integrand <- function (mu, x){ Peter Ehlers Thank you! Hannah f1<- function(x) {integrand <- function (x, mu){ dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1) } integrate(integrand, -Inf,

Re: [R] integration function

2011-06-25 Thread Peter Ehlers
on(mu){ integrand <- function (x, mu){ dnorm(x, mean=mu, sd=1) * dnorm(mu, mean=2, sd=1) } integrate(integrand, -Inf, Inf, mu)[["value"]] } But then again, you could just evaluate dnorm(mu, 2, 1). So I suspect that you want something different. Ditto for f2. Peter Ehl

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Peter Ehlers
i in seq_along(x) ) ok[i] <- any( apply(y - x[i], 1, prod) <= 0 ) x[ok] Peter Ehlers best, salih On Fri, Jun 24, 2011 at 4:12 PM, Dennis Murphy wrote: Hi: That leaves open several possibilities. Could you please supply a small, reproducible example (i.e., one that someone can co

Re: [R] text overlap in plot

2011-06-24 Thread Peter Ehlers
names() makes it the "data" argument. And it would be better to use the "data" argument than to attach/detach. Peter Ehlers This gets part of the way there using the spreadout function in plotrix, but it apparently needs to be set up so that it only gets applied within eac

Re: [R] packages which call functions which run C code...

2011-06-23 Thread Peter Ehlers
://svn.r-project.org/R/trunk/src/library/stats/src/ks.c for the relevant C code. Or download the source code from your favourite CRAN mirror. Peter Ehlers Thanks, -Steve Wolf [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Saved EPS does not match screen when using bquote(.(i))

2011-06-23 Thread Peter Ehlers
h_Canada.1252 [3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C [5] LC_TIME=English_Canada.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base Peter Ehlers On 2011-06-22 22:14, Dennis Murphy wrote: Hi: As Uwe suggested... pdf('testgraph.pdf')

Re: [R] problem (and solution) to rle on vector with NA values

2011-06-23 Thread Peter Ehlers
osed code modification is an improvement on the existing implementation of rle. Is it impertinent to suggest this R-modification to the gurus at R? Best wishes (in flame-war trepidation), Well, it's not worth a flame, but ... from the help page (see 'Details'): "Missing valu

Re: [R] Errorbars

2011-06-18 Thread Peter Ehlers
obtaining help.) Try setting the 'pch' parameter to NA or to "". Peter Ehlers Cheers Anna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] draw text outside plot boundaries

2011-06-06 Thread Peter Ehlers
?par and check out the 'xpd' parameter. Peter Ehlers i don't mind if it looks "messy" and steps on the margin a bit. - erik __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Wireframe, custom x-axis values

2011-06-06 Thread Peter Ehlers
second example in help('wireframe'): wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE, x = list(at = c(2, 5, 10)), y = list(at = c(6, 10, 14), lab = c('A', 'BBB', 'C')) )) Peter

Re: [R] modify a data frame by values in the columns

2011-06-04 Thread Peter Ehlers
On 2011-06-04 11:11, Peter Ehlers wrote: On 2011-06-03 13:34, Jason024 wrote: I have a data frame like this: col1 col2 r1 21 r2 43 r3 65 r4 87 r5109 r612 11 r714 13 r816 15 r918 17 r10 20 19 I want to modify this data

Re: [R] modify a data frame by values in the columns

2011-06-04 Thread Peter Ehlers
been struggling to make it to work. Any help is appreciated! This seems made for within(); calling your data.frame 'd': d.new <- within(d, { col1 <- ifelse(col1 < 12, -1, col1) col2 <- ifelse(col2 > 10, -1, col2)

Re: [R] Superscripts in strip labels of lattice plot

2011-06-03 Thread Peter Ehlers
;^2,'A'^3,'A'^4)), par.settings = list(layout.heights = list(strip = 1.5))) Peter Ehlers Here is an example that comes up on a search with terms expression& strip.default (which I thought was the correct argument to the strip parameter but turns out I was not rememb

Re: [R] lattice panel fine control

2011-06-03 Thread Peter Ehlers
thanks I suspect that you need to use the 'subscripts' argument. Peter Ehlers -- View this message in context: http://r.789695.n4.nabble.com/lattice-panel-fine-control-tp3566347p3570111.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Adding a line to a beside=TRUE barplot

2011-06-03 Thread Peter Ehlers
p <- barplot(t(dd), beside=TRUE) mp lines(colMeans(mp), cc, col=2, lwd=3) Peter Ehlers Many thanks, Galen [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] lattice + plotmath: how to get a variable in bold face?

2011-06-02 Thread Peter Ehlers
; ~ .(N) ~ "bar"))), font=2, cex=1.2)) ## => "font=2" is ignored (of course) You could add N <- as.character(N) before your call to xyplot. Peter Ehlers Cheers, Marius __ R-help@r-project.org mailing list https://stat

Re: [R] Create Matrix with Float32 values

2011-06-01 Thread Peter Ehlers
ied adding 0? Or you could use the seq() function. I assume that you have a reason for wanting this. Peter Ehlers __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] ideas about how to reduce RAM & improve speed in trying to use lapply(strsplit())

2011-05-30 Thread Peter Ehlers
uot;^(.*?)\\..*$","\\1",y, perl=TRUE) } newx <- unlist(L) Peter Ehlers Matt On Sun, May 29, 2011 at 6:44 PM, Ian Gow wrote: Not a new approach, but some benchmark data (the perl=TRUE speeds up Jim's suggestion): x<- c('18x.6','12x.9','302x.3&

Re: [R] panel.first problem when plotting with formula

2011-05-24 Thread Peter Ehlers
Someone have a straightforward silver bullet? No silver bullet, but this seems to work: plot(y ~ x, data=dat, type="n") points(y ~ x, data=dat, panel.first=bgfun()) (I think that plot.formula may need a fix but offhand I can't see whether that's easy or hard.) Peter Ehlers T

Re: [R] histogram with density

2011-05-24 Thread Peter Ehlers
called lines() without opening a graphics device. Peter Ehlers On Tue, May 24, 2011 at 9:22 AM, Steve Lianoglou< mailinglist.honey...@gmail.com> wrote: Hi, On Mon, May 23, 2011 at 11:41 PM, Rekha wrote: Hello All,* *I want to draw a histogram with density curve. * *For that simply i c

Re: [R] Applying boxplot.stats to multiple value lists

2011-05-23 Thread Peter Ehlers
different strings it works correctly> upex("bb") [... snip ...] Try the plyr package: require(plyr) ddply(testframe, .(Name), function(x) { boxplot.stats(x[["Value"]])[["stats"]][5]}) Peter Ehlers __ R-help@r-project.org mailing

Re: [R] unwanted coercion using apply

2011-05-22 Thread Peter Ehlers
o be of the same type). This is documented in ?apply. I am not sure if this is indended behaviour or not, but is there an elegant way to apply 'as.list' to all of the dataframe rows without coercing everything to strings? This may not be elegant, but why not just use a loop: L

Re: [R] scales argument in bwplot (lattice)

2011-05-20 Thread Peter Ehlers
this case I don't think that combineLimits answers Harold's request. Peter Ehlers Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 Email: home mac...@northnet.com.au At 01:29 18/05/2011, you wrote: On 2011-05-17 06

Re: [R] Grouped bar plot

2011-05-18 Thread Peter Ehlers
;: barplot(t(d[-1]), names.arg=d[,1], beside=TRUE) Give a careful reading to the definition of the 'height' argument on the help page. Peter Ehlers James __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Use paste function to select column of data

2011-05-18 Thread Peter Ehlers
he dollar habit. Replace your example$x with example[[x]] or with example[, x] Peter Ehlers Within the real function, I will continue do calculations on the column of data. My problem is that I am either getting a character expression or NULL from my function. Thanks for your he

Re: [R] scales argument in bwplot (lattice)

2011-05-17 Thread Peter Ehlers
(-3,3), c(-3,3), c(-60,90)) ) There's a comment on ?xyplot in the scales section: "When relation is "free", xlim or ylim can be a list, ..." Peter Ehlers Thanks Harold sessionInfo() R version 2.12.0 (2010-10-15) Platform: i386-pc-mingw32/i386 (32-bit

Re: [R] Post-hoc tests in MASS using glm.nb

2011-05-17 Thread Peter Ehlers
hasn't yet been introduced to the with() function, which is linked to on the ?attach page. Note also this sentence from the ?attach page: " attach can lead to confusion." I can't remember the last time I needed attach(). Peter Ehlers [... no

Re: [R] Subsetting depth profiles based on maximum depth by group with plyr

2011-05-17 Thread Peter Ehlers
>= which.max(.df$depth)),] --> .df[seq_len(nrow(.df))>= which.max(.df$depth),] (Thanks for providing a simple reproducible example.) Peter Ehlers Thanks in advance. Sam [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Fwd: Re: rbind with partially overlapping column names

2011-05-16 Thread Peter Ehlers
I had meant to copy the list on this; must have hit 'Reply' instead of 'Reply All'. P Ehlers Original Message Subject: Re: [R] rbind with partially overlapping column names Date: Mon, 16 May 2011 11:14:11 -0600 From: Peter Ehlers To: Jonathan Flowers

Re: [R] Quick question: Omitting rows and cols with certain percents of missing values

2011-05-13 Thread Peter Ehlers
for anyone to do that manually, though not for me. Can anyone please help me ? Example: set.seed(2718) m <- matrix(sample(1:9, 100, TRUE), 10, 10) is.na(m) <- sample(100, 20) d <- as.data.frame(m) d[rowSums(is.na(d)) / nrow(d) <= 0.2,] d[colSums(is.na(d)) / ncol(d) <= 0.

Re: [R] mtext text size (cex) doesn't match plot

2011-05-12 Thread Peter Ehlers
On 2011-05-12 07:16, George Locke wrote: thanks for reading the manual for me :X For a bit more reading, you could check out ?title. You could replace your mtext() calls with title(ylab='Y axis', cex.lab=1.5, line=4, font.lab=2) Peter Ehlers 2011/5/12 Prof Brian Ripley:

Re: [R] Dotplot (package Hmisc) with groups: colours and symbols

2011-05-11 Thread Peter Ehlers
rley, pch=c(1,2), col="black") No need to specify the panel function. (To see what's wrong with the panel function, add '...' to the arguments.) Peter Ehlers Many thanks in advance. Esther __ R-help@r-project.org mailing list

Re: [R] specifying scales in lattice xyplot makes the lines disappear?

2011-05-10 Thread Peter Ehlers
have expected the lines to plot and the axis labels not to be visible. Are you telling the whole story? _Minimal reproducible_ code is always a good thing. Peter Ehlers Thanks. --Chris Ryan __ R-help@r-project.org mailing list https://stat.

Re: [R] Pretty printing numbers

2011-05-09 Thread Peter Ehlers
ed. I see that you've had the solution you seek in terms of round(), but what exactly is wrong with the 'digits' argument? It works for me in the cases you cite. (Note that format = "f" is handled differently from other formats, according to ?formatC.) Peter Ehlers Is

Re: [R] abline outside of plot region

2011-04-29 Thread Peter Ehlers
ith R 2.13. plot(1:4, xaxt='n') axis(1, at=2:3, lab=c('a', 'b'), col.ticks=3, col.axis=2, lwd=0, lwd.ticks=1) par(xpd = TRUE) abline(v = 4) Peter Ehlers Nick Sabbe -- ping: nick.sa...@ugent.be link:<http://biomath.ugent.be/> http://bio

Re: [R] How can I extract information from list which class is nls

2011-04-26 Thread Peter Ehlers
eters', that doesn't make sense to me. Can you provide a sensible example? In any case you would no doubt have to look at the covariance matrix of the parameter estimates (with vcov()). Peter Ehlers str(summary(yourmodel)) Cheers, Josh On Tue, Apr 26, 2011 at 11:21 AM, Schatzi wrote:

Re: [R] Normality tests

2011-04-26 Thread Peter Ehlers
Put all your p.values into a vector and write that out. While you're at it, check ?str to see how handy the str() function is in identifying the pieces of an R object. Peter Ehlers Thank you very much for your time. Bruce Kindseth [[alternative HTML version de

Re: [R] Second largest element from each matrix row

2011-04-26 Thread Peter Ehlers
mount, I would choose Peter D's (f4) for its simplicity and transparency. I kind of figured that you'd do your magic and pull out a speed demon. Peter Ehlers f1<- function (x) +apply(x, 1, function(row) sort(row, decreasing = TRUE)[2]) f2<- function (x) + -appl

Re: [R] Second largest element from each matrix row

2011-04-26 Thread Peter Ehlers
u asked for more _efficient_ and I just thought 'shorter code'. I should know that whenver I think 'apply', I should think 'matrix'. Peter Ehlers I hope it helps. Best, Dimitris On 4/26/2011 2:01 PM, Lars Bishop wrote: Hi, I need to extract the second largest element f

Re: [R] Second largest element from each matrix row

2011-04-26 Thread Peter Ehlers
pply(a, 1, order, decreasing=T)[2,]) ans<- sapply(1:length(sec.large), function(i) a[i, sec.large[i]]) ans Try apply(a, 1, function(x) sort(x, decreasing=TRUE)[2]) Peter Ehlers Thanks in advance for your help, Lars. [[alternative HTML versio

Re: [R] what's wrong with plot(..., type="p")?

2011-04-26 Thread Peter Ehlers
f, plot(Sq~FACETTE, type="n")) I get boxplots in both cases. What should I do to get points instead of boxes? Thanks in advance for your help, Ivan Are you looking for stripchart()? Peter Ehlers __ R-help@r-project.org mailing list ht

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Peter Ehlers
o mimic the OP's code df <- data.frame(x = "2008-01-01") df$x <- as.POSIXlt(df$x, "%Y-%m-%d") str(df) #'data.frame': 1 obs. of 1 variable: # $ x: POSIXlt, format: "2008-01-01" Peter Ehlers __

Re: [R] extracting names from matrix according to a condition

2011-04-25 Thread Peter Ehlers
;] < 0.1, , drop=FALSE ]) should do what you want. Peter Ehlers __ 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, m

Re: [R] Problem with ddply in the plyr-package: surprising output of a date-column

2011-04-25 Thread Peter Ehlers
as.Date (or even nothing) on your Date variable, you'll find that ddply does what you want. To see why it doesn't work with strptime, check str(df) and then ?Posixlt. You've converted Date values to lists. My comment about cbind() is to warn you that your Values variable, as you have

Re: [R] random typing over text

2011-04-24 Thread Peter Ehlers
not R-specific, can such a quote be 'fortuned'? Peter Ehlers __ 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

Re: [R] Removing row with smallest value, for a given factor

2011-04-23 Thread Peter Ehlers
t I think that you meant dat[ !ave(dat$index, list(dat$day), FUN=function(x) x==min(x)), ] Here's another way, using the plyr package require(plyr) ddply(dat, .(day), .fun = function(x) subset(x, index != min(index))) Peter Ehlers -- David Winsemius, MD West Hart

Re: [R] Vertical bwplot and stripplot

2011-04-23 Thread Peter Ehlers
On 2011-04-23 08:03, David Neu wrote: On Sat, Apr 23, 2011 at 10:37 AM, Peter Ehlers wrote: On 2011-04-23 07:13, David Neu wrote: On Sat, Apr 23, 2011 at 9:47 AM, David Winsemius wrote: On Apr 23, 2011, at 9:26 AM, David Neu wrote: Hi, I'd like to change the default orientati

Re: [R] Vertical bwplot and stripplot

2011-04-23 Thread Peter Ehlers
(1, 3)) and I'd consider 'jitter'. BTW, your method of generating 'y' seems overly complicated: y <- sample(c("A","B","C"), 100, replace=TRUE, prob=c(1/2, 1/3, 1/6)) Peter Ehlers ___

Re: [R] Random Relabelling

2011-04-23 Thread Peter Ehlers
means<- apply(permutations, 1, mean) means And you might note that means <- rowMeansy(permutations) is about 10-15 times faster (if speed matters). Peter Ehlers [...snipped...] __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] combining matrices

2011-04-21 Thread Peter Ehlers
don't need this very often or very general, then use mat <- diag(0,4) mat[1:2, 1:2] <- A mat[3:4, 3:4] <- B mat If you do need more flexibility, you could use the 'assist' package's function bdiag() which handles block-diagonal matrices: require(assist) mat <

Re: [R] override default arguments in nested function

2011-04-21 Thread Peter Ehlers
(what = GPFoblq, tracer = expression(maxit<- 2000), at = 10, print = FALSE) to override the maximum number of iterations, which works but is a hassle. Anyone have other ideas/techniques? Thanks, Josh Does formals(GPFoblq)$maxit <- 2000 omega() do what you want? Peter

Re: [R] Help needed!

2011-04-20 Thread Peter Ehlers
e. You might also consider a more informative subject line. "Help needed" is true for all questions (not answers) on R-help. Just think, why is this list called R-***help***? Peter Ehlers Best, Shuangyan > __ R-help@r-project.org ma

Re: [R] user input

2011-04-20 Thread Peter Ehlers
the rpanel package. Might give you some ideas. Peter Ehlers Andreas Ivan Calandra schrieb: Dear users, I have looked on different sources and found different functions to prompt the user to provide input. However, I couldn't find one that does exactly what I'm looking for. select.

Re: [R] Simple question

2011-04-19 Thread Peter Ehlers
Seconded. Peter Ehlers On 2011-04-19 14:11, Marc Schwartz wrote: On Apr 19, 2011, at 4:08 PM, Rolf Turner wrote: On 20/04/11 07:19, Steven Wolf wrote: [...snip...] It sounds to me like you don't understand lists. If you are going to use R you really should understand them. They

Re: [R] Robustbase source question

2011-04-19 Thread Peter Ehlers
ot in robustbase. Look for partial sorting here: https://svn.r-project.org/R/trunk/src/main/sort.c Peter Ehlers thanks, -- View this message in context: http://r.789695.n4.nabble.com/Robustbase-source-question-tp3459966p3459966.html Sent from the R help mailing list archive at Nabbl

Re: [R] How to Extract Information from SIMEX Output

2011-04-19 Thread Peter Ehlers
ation.variance$model$variance.jackknife or z <- fit.simex[['extrapolation.variance']] z[['model']][['variance.jackknife']] Peter Ehlers str(fit.simex) List of 24 $ coefficients : Named num [1:2] -17.1 3 ..- attr(*, "names")= chr [1:2]

Re: [R] altering identity column

2011-04-18 Thread Peter Ehlers
ip]> Now is there a quick way to alter this indexing of rows in case of my "transformed_dataframe"? I mean, I would rownames(newdata)<- 1:nrow(newdata) or, perhaps a bit simpler rownames(newdata) <- NULL Peter Ehlers __ R-help@

Re: [R] side by side histogram after splitting data by year

2011-04-18 Thread Peter Ehlers
ou may want to look at the histbackback() function in pkg Hmisc. Peter Ehlers [...snip...] On Sun, Apr 17, 2011 at 10:51 AM, Stratford, Jeffrey wrote: Hi everyone, I'm looking to produce a side-by-side histogram of the number of trips taken by jays with a particular number of aco

Re: [R] Rsquared for anova

2011-04-17 Thread Peter Ehlers
ot most, of your predictors should be factors. Peter Ehlers I have attached the dataset, feel free to take a look at it. So far, running it with alle the combinations did not take too long and there seem to be some effects between the parameters. However, 2x2 combinations might suffice. T

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Peter Ehlers
retty close to what I want, but here's where I'm stuck: How do I move the x-axis labels to the _center_ of each bar? Right now, they line up with the right-side of each bar. Try to set the parameter: adj=.5 (see ?par). HTH, *S* That won't work (try it). Use text(1:4-0.5,

Re: [R] How to make truncated y axis (cut mark) in R plot?

2011-04-16 Thread Peter Ehlers
On 2011-04-15 16:42, Bill Hyman wrote: Hi friends, Does anyone know how to make truncated y axis with cut mark (\\) in R plot? Many thanks! See axis.break() in the plotrix pkg. Peter Ehlers Bill __ R-help@r-project.org mailing list https

Re: [R] Rsquared for anova

2011-04-16 Thread Peter Ehlers
insight... Are you seriously contemplating up to 10-way interactions? I hope that you have a great deal of data and much patience as you attempt to interpret those interactions. Peter Ehlers Dorien On 15 April 2011 18:07, Dieter Menne wrote: dorien wrote: I calculate an anova test

Re: [R] How to see a R code from a package?

2011-04-14 Thread Peter Ehlers
uld be to download the source file. There's nothing being 'protected by the programmer'. This might also be a good time to check out ?methods. Peter Ehlers Soyeon On Thu, Apr 14, 2011 at 1:18 PM, Jannis wrote: Just type the name of your function without (). Or use fix(). Or

Re: [R] The three routines in R that calculate the wilcoxon signed-rank test give different p-values.......which is correct?

2011-04-13 Thread Peter Ehlers
.08143996 You can get the results from wilcox.exact() with pvalue(wilcoxsign_test(x ~ y, zero.method="Wilcoxon", distribution="asympt")) #[1] 0.05061243 and pvalue(wilcoxsign_test(x ~ y, zero.method="Wilcoxon", dist="exact")) #[1] 0.05

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Peter Ehlers
out kludge to do what the OP wants. ... That might work. Or try this, replacing QQQ with the name of the object you want to keep. rm(list=ls()[!grepl('^QQQ$',ls())]) cur package gdata has function keep() which does just what the OP asks for. Peter Ehlers

Re: [R] Zoom on simple.violinplot

2011-04-12 Thread Peter Ehlers
On 2011-04-12 02:50, Peter Ehlers wrote: On 2011-04-11 09:44, PhDGuy wrote: Hello, I am using the function simple.violinplot from the package UsingR. I have some outliers in my dataset so that the distribution has very long tails. As a result, the y-axis of the output of simple.violinplot

Re: [R] Zoom on simple.violinplot

2011-04-12 Thread Peter Ehlers
zoom on the y-axis with a command such as ylim=c(a,b), as in boxplot(x,ylim=c(a,b)). However, doing simple.violinplot(x,ylim=c(a,b)) does not work. Is there any way out? Check out the zoomplot() function in the TeachingDemos package. Peter Ehlers -- View this message in context: http://r

Re: [R] Non linear Regression: "singular gradient matrix at initial parameter estimates"

2011-04-12 Thread Peter Ehlers
ameterized. How can I work around that? Take out p3; it's redundant. Peter Ehlers Thanks, Felix [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Polar Plots

2011-04-11 Thread Peter Ehlers
e following works for me (note: I'm using Jim Lemon's well-known penchant for eschewing the spacebar): testlen<-rnorm(24)*2+5 testpos<-0:23+rnorm(24)/4 clock24.plot(testlen,testpos,show.grid=FALSE,line.col=3) clock24.plot(testlen[7:19],testpos[7:19],point.col=4,rp.type="s",point.

Re: [R] Question about levels/as.numeric

2011-04-10 Thread Peter Ehlers
Thibault, Your questions indicate that you would benefit enormously from reading 'An Introduction to R'. A very useful function is str(). Understanding the concept of "factors" is crucial in R. "Checking" anything with Excel is never much use. Peter Ehlers

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Peter Ehlers
On 2011-04-10 12:19, Jeff Stevens wrote: Many thanks, Peter. This works brilliantly, and I prefer to have the labels assigned outside of panel function as well. Cheers, Jeff Small add-on: It's probably best to ensure that the labels are of type character, not factor. Peter [...snip...] ___

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-10 Thread Peter Ehlers
1","f2")]), "", lab)) ## now use lab2 in bwplot() bwplot(dv ~ f1 | f2, data = df, ylim = c(0.5, 1), panel = function(x, y, ..., subscripts) { lab <- df$lab2[subscripts] # note the lab2 panel.bwplot(x, y, ...) panel.text(x, 0.55, labels = lab) } ) Pet

Re: [R] Adding text labels to lattice plots with multiple panels

2011-04-09 Thread Peter Ehlers
ata = df, ylim = c(0.5, 1), panel = function(x, y, ..., subscripts) { at.y <- rep(0.55, nrow(df)) is.na(at.y) <- which(duplicated(df$lab)) panel.bwplot(x, y, ...) panel.text(x, at.y[subscripts], labels = df$lab[subscripts]) } ) I think that the alpha argument is too o

Re: [R] Windrose Percent Interval Frequencies Are Non Linear! Help!

2011-04-08 Thread Peter Ehlers
fill.col='yellow', cir.ind=NULL, bins=1) symbols(0, 0, circles=1, inches=FALSE, fg="red", add=TRUE) You could also have a look at the draw.circle() function in the plotrix package. Peter Ehlers __ R-help@r-project.o

Re: [R] Windrose Percent Interval Frequencies Are Non Linear! Help!

2011-04-07 Thread Peter Ehlers
he percent intervals are evenly spaced? Hopefully I am making sense here How about giving us a reproducible example? Code is better than mere description; code + description is best. Peter Ehlers Thanks. britt [[alternative

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Peter Ehlers
On 2011-04-06 15:21, Marius Hofert wrote: Haha, I found a hack (using the letter "l"): plot(0,0,main=expression(italic(X)[1]^bolditalic("l"))) To my eye, this is a bit neater: expression(italic(X)[1]^bold("/")) Peter Cheers, Marius __ R-help

Re: [R] Teradata ODBC driver

2011-04-06 Thread Peter Ehlers
. http://downloads.teradata.com/download/applications/teradata-r/1.0 I just tried this with Firefox 3.6.16 and had no problem. Proxy server? Peter Ehlers Is there an alternative site or location for obtaining the necessary driver? Thanks WHP [[alternative HTML version deleted

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Peter Ehlers
see inline; On 2011-04-06 14:22, Peter Ehlers wrote: On 2011-04-06 14:14, Marius Hofert wrote: Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Peter Ehlers
=expression(italic(X)[1]*minute)) Any suggestions? Hmm ; your subject line is a clue: expression(italic(X)[1]^minute) Note the '^'. Peter Ehlers Cheers, Marius __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] lattice: how to "center" a subtitle?

2011-04-04 Thread Peter Ehlers
xyplot(0 ~ 0, xlab = xlab) Marius, I always find paste a bit tricky with plotmath. Maybe this will do what you want: mylab <- expression( atop(lab==list(alpha==1, beta==2), bold(foo)) ) xyplot(0 ~ 0, xlab = mylab) Peter Ehlers Cheers, Marius On 2011-04-04, at 18:59 , David Winsemius wr

Re: [R] gap.barplot doesn't support data arrays?

2011-04-04 Thread Peter Ehlers
tation is somewhat spotty. The help page for gap.barplot indicates that the input 'y' should be 'data values'; not overly informative. Peter Ehlers Thanks, Drew Steen __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Peter Ehlers
able results, you can add the prettyfying statements back in. If you still get errors, then either I'm out-to-lunch (quite possible!) or you need to use debug() to figure out what's going on. Peter Ehlers On 2011-04-01 14:59, David Winsemius wrote: On Apr 1, 2011, at 5:38 PM, steve_fried..

Re: [R] filled contour plot with contour lines

2011-04-01 Thread Peter Ehlers
Aren't you missing a set of parentheses? I can't run your code since it's not reproducible, but to my aging eyes it seems that you need a set of '{}' around the contents of your loop: for(j in 1:(varsize[4]-1)) { loop stuff } Peter Ehlers On 2011-04-01 11:48, ste

Re: [R] mean in the boxplot

2011-04-01 Thread Peter Ehlers
ransparent" in the boxplot() call. But then again, the whole point of a boxplot is to represent general distributional shape for which the median is surely more effective. Peter Ehlers __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] Fisher's test

2011-04-01 Thread Peter Ehlers
use apply to speed up aclculation of the fisher.exact test? apply(yourMatrix, 1, function(x) fisher.test(cbind(x, 100 - x))) or, if you only want the P-value: apply(yourMatrix, 1, function(x) fisher.test(cbind(x, 100 - x))$p.value) Peter Ehlers

Re: [R] Linear Model with curve fitting parameter?

2011-04-01 Thread Peter Ehlers
e additive errors on the original scale. But your model looks simple enough - why not run it through both functions and see what the difference is. Ultimately, everything depends on what assumptions you're comfortable with. Peter Ehlers Stephen On Thu, Mar 31, 2011 at 8:34 PM, Steven

Re: [R] ANCOVA for linear regressions without intercept

2011-04-01 Thread Peter Ehlers
that includes intercepts. If the intercepts turn out to be significantly nonzero, what will you do? Peter Ehlers I also tried lm(body_length ~ sex*head_length-1) lm(body_length ~ sex*head_length-sex-1) But none of them worked. Would anyone be able to help me? All I want to do is to compare th

Re: [R] Simple lattice question

2011-04-01 Thread Peter Ehlers
Ruben, One more thing you might try is to add a 'size' component to the lines list. The default is size=5, but since you have enought space in the plot, try size=8 or 9; the line types will show up more clearly: lines=list(pch=1:4, lty=1:4, type='b', size=8),

Re: [R] Simple lattice question

2011-03-31 Thread Peter Ehlers
groups=z,layout=c(2,3), pch=1:4,lty=1:4,col='black',type='b', key=list(x = .65, y = .75, corner = c(0, 0), title="title here", cex.title=.9, lines.title=3,

<    1   2   3   4   5   6   7   8   9   10   >