[R] Is dataset "headsize" from MVA or HSAUR2 packages missing or am I missing something ?

2014-07-28 Thread ottorino
;) Datasets from the same book are nevertheless available, such as "heptathlon", "pottery", "USairpollution" Am I missing something obvious here ? Thanks in advance -- Ottorino-Luca Pantani, Università di Firenze Dip.to di Scienze delle Produzioni Agroalimentari e de

Re: [R] Is dataset "headsize" from MVA or HSAUR2 packages missing or am I missing something ?

2014-07-29 Thread ottorino
I answer to myself, just in case someone in the future will need this. The data set for headsize is named "frets", from the name of the author who collected data in 1921, and it is available once the the library "boot" is loaded. Il giorno lun, 28/07/2014 alle 15.46 +0200,

[R] How to "source" a R script in a parent/parallel directory (win/linux)

2013-06-11 Thread ottorino
ertThisFigure.pdf} so something like source("../PROGRAM/RunThis.R") would have been worked. but it didn't I tried a brute attempt like the following: step.back <- setwd("..") source(file.path(step.back, ""RunThis.R")) but without success. Any suggestion

[R] superpose.polygon, panel.polygon and their colors

2010-10-19 Thread ottorino
upper <- upper[subscripts] lower <- lower[subscripts] panel.polygon(c(x, rev(x)), c(upper, rev(lower)), border= 2, ...) } xyplot(est ~ x | cond, group = grp, data = data, type = 'b', upper = data$upper, lower = data$lower, panel = function(x, y, ...){

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-19 Thread ottorino
Il giorno mar, 19/10/2010 alle 11.12 -0700, Dieter Menne ha scritto: Thanks Dieter for your help, but unfortunately your suggestion results only in changing the color of the *lines* and not the color of the *area* of the polygon. I also tried to call "col" from within the panel.superpose xyplot(

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-20 Thread ottorino
Il giorno mer, 20/10/2010 alle 00.05 -0700, Dieter Menne ha scritto: > The following complete code works for me. Do you have the current version > of lattice/R installed? > So the problem could be somewhere else. I suspected some of this kind. RShowDoc("NEWS", package = "lattice") tell me that

Re: [R] superpose.polygon, panel.polygon and their colors

2010-10-20 Thread ottorino
Il giorno mer, 20/10/2010 alle 03.05 -0700, Dennis Murphy ha scritto: > Works for me! Thanks, Dieter! Hi all. Thanks again to you both for the help. It was a problem due to a lack in updating ubuntu. After the upgrade to Lucid I entirely forgot to update /etc/apt/sources.list with the new lines.

[R] LATTICE. On skip, index.cond with a formula like Y~X|A+B

2010-11-16 Thread ottorino
panel.abline(coef(lm(y ~ x), col=2)) }) ) # The formula |TREAT+REF results in a # "index.cond" which is obviously a list with one element for # each factor my.plotTwoLines$index.cond # In this case I think I can only remove columns or rows, but not single # panels. # Any suggestion ?

Re: [R] Simple error handling in R

2010-11-16 Thread ottorino
ou are looking for for(i in 1:10){ if (i == 5) {browser()} print("anything")} Browser stop the execution and allows you to indagate about -- Ottorino-Luca Pantani, Università di Firenze Dip.to di Scienze delle Produzioni Vegetali, del Suolo e dell'Ambiente Forestale (DiPSA) P

Re: [R] lattice: strange behavior (?) when using trellis.device(color=FALSE)

2010-11-27 Thread ottorino
Il giorno sab, 27/11/2010 alle 00.35 +0100, Marius Hofert ha scritto: > The reason why I would like to use trellis.device() within a function > is that > the plot contains a panel.function which contains many calls to > panel.xyplot() > and I do not want to write "col = 1" (e.g.) all the time...

[R] Prettier axis labels when using log (or exp!!) scales in Lattice (follow up)

2011-07-05 Thread ottorino
Hi all, my mail is a follow up of this thread http://tolstoy.newcastle.edu.au/R/e12/help/10/11/4172.html. I'm trying to alter the labels of an xyplot where the y variable is in the order of millions (cell counts) I've found plenty of examples on the R mailing list archives as well as in the book

[R] substitution of the ASCII character "squared" AKA "^2" AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
t possible to change that string at the source, but it is possible only on manual basis, quite inconvenient if you have to process many files. Any help ? I'm quite discouraged ... -- Ottorino-Luca Pantani, Università di Firenze Dip.to di Scienze delle Produzioni Vegetali, del Suolo e dell'Ambie

Re: [R] substitution of the ASCII character "squared" AKA "^2" AKA (alt+0178) with a tractable one

2012-04-10 Thread ottorino
Il giorno mar, 10/04/2012 alle 09.54 -0400, David Winsemius ha scritto: > Perhaps, modulo encoding issues I'm not expert in, one more > backslash > than you tried: > > > gsub( "\\\xb2" , "2", > "(MPa)\t(mm3)\t(nM)\t(mm3/g)\t(mm3/g)\t(%)\t(m > \xb2/g)\t") > [1] "(MPa)\t(mm3)\t(nM)\t(mm3/g)\t(mm

[R] R code to reproduce (while studying) Bates & Watts 1988

2009-08-13 Thread Ottorino-Luca Pantani
quot;correlation = corAR1()" in updating a nls model). Could someone be so kind to help me ? Thanks a lot Ottorino "df.Chloride"<- structure(.Data = list(time = c(2.45, 2.55, 2.65, 2.75, 2.85, 2.95, 3.05, 3.15, 3.25, 3.35, 3.45, 3.55, 3.65, 3.75, 3.85, 3.95, 4.05, 4.15,

[R] [Fwd: Re: R code to reproduce (while studying) Bates & Watts 1988]]]

2009-08-17 Thread Ottorino-Luca Pantani
Kevin Wright wrote: library(nlme) m2 <- gnls(conc ~ t1*(1-t2*exp(-k*time)), data = df.Chloride, start = list( t1 = 35, t2 = 0.91, k = 0.22)) So my error was to use nls instead that gnls. Thanks a lot, Kevin. summary(m2) plot(m2) l

Re: [R] Rounding to the nearest 5

2009-08-17 Thread Ottorino-Luca Pantani
milar problem in the past Take a look at http://tolstoy.newcastle.edu.au/R/e4/help/08/05/11017.html and to the replies -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizione della Pianta P.zle Cascine 28 50144 Firenze Italia Tel 39 055 3288 202 (348 lab) Fax 39 055 33

Re: [R] [Fwd: Re: R code to reproduce (while studying) Bates & Watts 1988]]]

2009-08-18 Thread Ottorino-Luca Pantani
Douglas Bates ha scritto: I have been without Internet access for a couple of weeks (in the US AT&T is now competing with the cable companies and has succeeded in emulating the cable TV companies' terrible service) and I missed the beginning of this discussion. Is there a reason that you have n

Re: [R] how to Transpose a dataset

2009-08-19 Thread Ottorino-Luca Pantani
look also at ?stack ?reshape -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizione della Pianta P.zle Cascine 28 50144 Firenze Italia Tel 39 055 3288 202 (348 lab) Fax 39 055 333 273 olpant...@unifi.it http://www4.unifi.it/dssnp

Re: [R] mild and extreme outliers in boxplot

2009-08-19 Thread Ottorino-Luca Pantani
Rnewbie ha scritto: dear all, could somebody tell me how I can plot mild outliers as a circle(°) and extreme outliers as an asterisk(*) in a box-whisker plot? Thanks very much in advance ?boxplot or help(bxp) __ R-help@r-project.org mailing lis

Re: [R] edit.row.names taking row names from the edited dataframe

2009-08-19 Thread Ottorino-Luca Pantani
Erik Iverson ha scritto: This really has nothing to do with the "row names" issue you mention, as far as I can tell. It has to do with this: http://stackoverflow.com/questions/1195826/dropping-factor-levels-in-a-subsetted-data-frame-in-r Best, Erik Iverson Perhaps you may also take a l

Re: [R] visualizzazione colonne

2009-08-19 Thread Ottorino-Luca Pantani
olumn from 7 to 8. Ciao -- Ottorino-Luca Pantani, Università di Firenze __ 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

Re: [R] how to compute other columns without a column for sample name

2009-08-19 Thread Ottorino-Luca Pantani
sandsky ha scritto: Data has the first row for variable name and the first column for sample name. I want to take "Log" for all data, but how to compute without the first column for sample name. log.raw_data=log(raw_data,base=2) Error in Math.data.frame(list(sample_id = c(1L, 2L, 3L, 4L

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Ottorino-Luca Pantani
s not evident from your post. Probably due to its conciseness, I thought it was in the style "I have a problem, I do not want to study to solve it, need someone to do it for me" I realize now it was not the case. I apologize for this. Ottorino That’s why I made the post. Whether I can e

Re: [R] mild and extreme outliers in boxplot

2009-08-20 Thread Ottorino-Luca Pantani
aspect of the plot, uncorrectly assuming that it could be extended to the problem of Rnewbye. I surely made a mistake, and I apologize for this. This is is my only fault. BUT PLEASE do not forget that if Rnewbye answered to my post (with a piece of code for example) I would have helped him. A

[R] [Fwd: Re: Several simple but hard tasks to do with R]

2009-08-20 Thread Ottorino-Luca Pantani
Emacs will be useful in MANY other ways. -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizione della Pianta P.zle Cascine 28 50144 Firenze Italia Tel 39 055 3288 202 (348 lab) Fax 39 055 333 273 olpant...@unifi.it http://www4.unifi.it/dssnp/

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Ottorino-Luca Pantani
Rakknar ha scritto: 1. Make a log. I've been using Stata and there i have a great tool to register what the program do: the log file, wich it's a simple .txt file where Stata writes every output it makes (not graphics of course). When I wanted to make the same thing with R I started to use the f

Re: [R] natural sorting a data frame /vector by row

2009-08-24 Thread Ottorino-Luca Pantani
red <- df.newdata[sort(df.newdata$foo),] another solution could be to rename the items in column 1 -- Ottorino __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

Re: [R] Select top three values from data frame

2009-08-26 Thread Ottorino-Luca Pantani
df.mydata[df.mydata$A=="X" AND df.mydata$C < 2, ] will do the job ? 8rino Noah Silverman ha scritto: Hi, I'm trying to find an easy way to do this. I want to select the top three values of a specific column in a subset of rows in a data.frame. I'll demonstrate. ABC x21 x

Re: [R] Select top three values from data frame

2009-08-26 Thread Ottorino-Luca Pantani
Noah Silverman ha scritto: I only have a few values in my example, but the real data set might have 20-100 rows with A="X". So how do I pick just the three highest ones? -N On 8/26/09 2:46 AM, Ottorino-Luca Pantani wrote: df.mydata[df.mydata$A=="X" AND df.mydata$C &l

Re: [R] Book on R programming

2009-08-31 Thread Ottorino-Luca Pantani
points -- Ottorino __ 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.

[R] dividing a dataframe column by different constants

2009-09-03 Thread Ottorino-Luca Pantani
) ) MAX <- tapply( df.mydata$CONC, df.mydata$SAMPLE, max ) (df.mydata$PERCENTAGE <- ifelse(df.mydata$SAMPLE == "A", df.mydata$CONC / MAX[1], ifelse(df.mydata$SAMPLE == "B", df.mydata$CONC / MAX[2], df.mydata$CONC / MAX[3]))) -- Ottorino-Luca Panta

[R] Multicolor main title in a plot or mtext

2010-04-22 Thread Ottorino-Luca Pantani
I have in mind is something similar to the latex code \color{black}{1st treatm} \color{red}{2nd treatm} \color{green}{3rd treatm} Which pages of the R manual should I have to read to solve my problem ? Thanks in advance -- Ottorino-Luca Pantani, Università di Firenze Dip.to di Scienze delle Produz

[R] insert a text in panels, always in the same position (lattice, ltext, ?prepanel?)

2009-10-30 Thread Ottorino-Luca Pantani
panel.default.xyplot(list(ylim[2])) but without success labels = paste("p", as.character(round(p.value.diff, 3)), sep = "=")) } ## xyplot(x ~ d| a + b + c, data = df, layout = c(6, 2), strip = strip.custom(strip.names = TRUE, strip.levels =TRUE),

[R] How to properly shade the background panels of an xyplot?

2009-10-30 Thread Ottorino-Luca Pantani
in the panel, but I cannot imagine how to do it with variables external to the panel itself. I suppose that the panel functions are not useful here. I'm wandering through par.settings, themes and panel.fill, but still without success. Any hint ? -- Ottorino-Luca Pantani, Università d

[R] Rearranging long tables, Sweave, xtable, LaTeX

2009-11-12 Thread Ottorino-Luca Pantani
? In other words I do not want to use \longtables and the similar. Where should I look for info ? In Latex ? In Sweave ? In xtable ? Thanks a lot -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizione della Pianta P.zle Cascine 28 50144 Firenze Italia Tel 39 055

Re: [R] Rearranging long tables, Sweave, xtable, LaTeX

2009-11-12 Thread Ottorino-Luca Pantani
Ista Zahn ha scritto: Yeah, I've had this kind of situation before. Usually I first see if I can fit it on the page by rotating it and/or reducing the size. If that doesn't do it then I'll re-arrange as you suggest. Basically the print method is just wrapping the output after n columns (27 in my

[R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Ottorino-Luca Pantani
e help is quite complicate to understand (at least to me, at this moment in time) I can search the vector through grep("V_._", foo) but I always get errors either on gsub('V_\(.\)_', 'V_0\1_', foo) or I get not what I'm looking f

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Ottorino-Luca Pantani
Duncan Murdoch ha scritto: On 11/16/2009 8:21 AM, Ottorino-Luca Pantani wrote: Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. You were close. First, gsub by default doesn't need escapes before the parens. (There are lo

[R] Again on overlaying plots (a plot region within a plot region)

2009-12-02 Thread Ottorino-Luca Pantani
the plot region nor the figure region. One solution could be to export PLOT 1 , say as png, and then overlay on it PLOT 2 with pixmap() as in this example http://www.stat.auckland.ac.nz/~paul/RGraphics/custombase-pixmap.R but it seems to me a bit too much complicate Thanks in advance for your time

[R] Sweave, xtable plus/minus sign

2010-06-29 Thread Ottorino-Luca Pantani
possible workaround could be : ... foo.df <- as.data.frame(foo) foo.df$Std.Dev <- paste("±", round(mySD,2), sep="") tmpTable <- xtable(foo.df, caption ="Simulated data", label="tab:five", digits=2) print(tmpTable, caption.placement="top&q

Re: [R] Sweave, xtable plus/minus sign

2010-06-29 Thread Ottorino-Luca Pantani
On 29/06/2010 17:36, Marc Schwartz wrote: On Jun 29, 2010, at 10:08 AM, Ottorino-Luca Pantani wrote: paste("$\\pm$", 1.34, sep="") [1] "$\\pm$1.34" I believe you then need to tweak the sanitize.text.function argument in print.x

Re: [R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Ottorino-Luca Pantani
Charilaos Skiadas ha scritto: On May 9, 2008, at 5:39 AM, Dieter Menne wrote: If I understand the OP's question properly, the first value is to be a multiple of 50, the second a multiple of 5, and the third a multiple of 1. This can be done with this slight variation on the above theme: a <-

[R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-06 Thread Dr. Ottorino-Luca Pantani
ing, trunc, and floor but without success. Any hint to solve this problem ? Thanks a lot http://www.openofficetips.com/blog/archives/2005/04/rounding_to_the.html http://www.gnome.org/projects/gnumeric/doc/gnumeric-MROUND.shtml -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e N

[R] Is there in R a function equivalent to the mround, as found in most spreadsheets?

2008-05-09 Thread Dr. Ottorino-Luca Pantani
or but without success. Any hint to solve this problem ? Thanks a lot http://www.openofficetips.com/blog/archives/2005/04/rounding_to_the.html http://www.gnome.org/projects/gnumeric/doc/gnumeric-MROUND.shtml -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizione del

[R] Why I cannot get the intervals from "Rails" data ?

2008-01-24 Thread Dr. Ottorino-Luca Pantani
mero di indici non corretto that translated should sounds like Error in out[, "est.", ] <- coeff[, "Estimate", ] : not correct indexes number What is that I'm not considering here ? Thanks -- Ottorino-Luca Pantani, Università di Firenze Dip. Scienza del Suolo e Nutrizi

[R] on trellis.par.set/get (reproducing figures from Pinheiro & Bates)

2008-01-29 Thread Dr. Ottorino-Luca Pantani
st(text = 12, points = 10) ) trellis.par.set(prove.theme) plot(ergoStool) I also queried trellis.par.get by names(trellis.par.get()) but still I'm not able to figure out which are the parameters, if any, that control "pch" and "col" of the symbols. Any help is h

Re: [R] on trellis.par.set/get (reproducing figures from Pinheiro & Bates)

2008-01-30 Thread Dr. Ottorino-Luca Pantani
Deepayan Sarkar ha scritto: > On 1/29/08, Dr. Ottorino-Luca Pantani <[EMAIL PROTECTED]> wrote: > >> Dear R users, >> I would like to exactly reproduce a figure like the 1.5 or 1.9 or 4.13 >> from the book >> Mixed effects models in S and S-Plus. >> Not