[R] Unexpected behaviour of plyr::ddply

2014-09-16 Thread walmes .
, the result of aggregate is showed. Why this behaviour? What I can do to avoid it? > require(plyr) > > hab <- + read.table("http://www.leg.ufpr.br/~walmes/data/ipea_habitacao.csv";, +header=TRUE, sep=",", stringsAsFactors=FALSE, quote="&qu

Re: [R] Apply rmarkdown::render() outside the RStudio don't find pandoc

2014-08-28 Thread walmes .
h-implicit_figures --output teste01.html --smart --email-obfuscation none --standalone --section-divs --table-of-contents --toc-depth 3 --template /home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html --css /home/walmes/Dropbox/ridiculas/markdown/ridiculas.css --variable the

[R] Apply rmarkdown::render() outside the RStudio don't find pandoc

2014-08-28 Thread walmes .
html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output teste01.html --smart --email-obfuscation none --standalone --section-divs --table-of-contents --toc-depth 3 --template /home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html -

[R] Diference in results from doBy::popMeans, multcomp::glht and contrast::contrast for a lme model

2012-11-05 Thread Walmes Zeviani
incipal results are appended. Thank you. # reading BIB data da <- read.table("http://www.leg.ufpr.br/~walmes/data/pimentel_bib3.txt";, + header=TRUE, sep="\t", colClasses=c("factor","factor",NA)) str(da) ## 'data.frame':30 ob

Re: [R] question how to add Standard Deviation as "Whiskers" in a simple plot

2012-05-28 Thread Walmes Zeviani
This post are useful. http://myowelt.blogspot.com.br/2008/03/beautiful-error-bars-in-r.html http://mapas.mma.gov.br/i3geo/pacotes/rlib/win/gplots/html/plotCI.html Walmes. == Walmes Marques Zeviani LEG (Laboratório de

Re: [R] confidence intervals for nls or nls2 model

2012-05-16 Thread Walmes Zeviani
If you want a confidence based in new x values you can do. I have this post with steps to do this. It's written in Portuguese but the R code is useful. http://ridiculas.wordpress.com/2011/05/19/bandas-de-confianca-para-modelo-de-regressao-nao-linear/ Bests. W

Re: [R] error bars for a barchart

2012-05-01 Thread Walmes Zeviani
I have a repoducibe example here http://ridiculas.wordpress.com/2011/11/23/media-e-desvio-padrao-de-muitas-variaveis-separado-por-grupos/ Sorry for it be in Portuguese. Walmes. == Walmes Marques Zeviani LEG (Laboratório de

Re: [R] VarCorr procedure from lme4

2012-05-01 Thread Walmes Zeviani
It could be a bad coexistence between packages in the same R session. Are you using nlme and/or doBy packages too? Bests. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S

Re: [R] How to test if a slope is different than 1?

2012-04-25 Thread Walmes Zeviani
~b0+x1+b2*x2, start=c(b0=1, b2=1)) nls.h1 <- nls(y~b0+b1*x1+b2*x2, start=c(b0=1, b1=1, b2=1)) summary(nls.h1) anova(nls.h0, nls.h1) another option is to adjust a model parametrized according to test h0, like nls.h2 <- nls(y~b0+(b1+1)*x1+b2*x2, start=c(b0=1, b1=-1, b2=1)) summary(nls.

Re: [R] Encoding of Sweave file error message

2012-04-11 Thread Walmes Zeviani
I had the same problem! So, as I'm a linux user, I prefer use linux terminal. On terminal I type this to compile R CMD Sweave --encoding=utf-8 myfile.Rnw and the compilation is successful. Try to set the encoding option in Sweave(). Bests. W

Re: [R] Lattice densityplot with semitransparent filled regions

2012-04-11 Thread Walmes Zeviani
Thank you Ilai. Problem solved. There is a small detail, alpha affects the rug and the curve line opacity too. Is possible to specify it just to polygon? Bests. == Walmes Marques Zeviani LEG (Laboratório de Estatística e

[R] Lattice densityplot with semitransparent filled regions

2012-04-11 Thread Walmes Zeviani
lygon") to fill densityplot(~y|B, groups=A, data=dt, plot.points="rug", col=2:3, panel=panel.superpose, panel.groups=my.panel.densityplot) Thanks! Walmes. == Walmes Marques Zevian

Re: [R] Odp: Multiple plots in one subplot

2011-12-16 Thread Walmes Zeviani
You can use a different way of split the plotting area that is by means of layout() function. x <- rnorm(100) M <- matrix(c(rep(1:5, e=2), 6, 7), byrow=TRUE, nrow=2) layout(M) plot(x) hist(x) qqnorm(x) boxplot(x) plot(density(x)) plot(abs(x)) hist(abs(x)) Bests.

[R] multcomp::glht() doesn't work for an incomplete factorial using aov()?

2011-08-06 Thread Walmes Zeviani
;A")) summary(m0) coef(m0) # adjust incomplete factorial m1 <- aov(y~cult*fert, da) summary(m1) coef(m1) require(multcomp) glht(m0, linfct=matrix(c(1,1,10,0), nrow=1)) # work glht(m1, linfct=matrix(c(1,1,0,10,0), nrow=1)

[R] How set lm() to don't return NA in summary()?

2011-08-05 Thread Walmes Zeviani
tC:fertNA NA NA NA ... > require(gmodels) > estimable(m0, cm=c(1,0,0,100,0,0)) Erro em estimable.default(m0, cm = c(1, 0, 0, 100, 0, 0)) : Dimension of structure(c(1, 0, 0, 100, 0, 0), .Dim = c(1L,

[R] Tables and merge

2011-07-05 Thread Walmes Zeviani
.org/doku.php?id=tips:data-frames:merge You can also join to the R-br mailing list (brazilian R-help list). Instructions in http://www.leg.ufpr.br/doku.php/software:rbr Bests. Walmes. ====== Walmes Marques Zeviani LEG (Laborat

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

2011-06-30 Thread Walmes Zeviani
exp(((-4*pi*En*Na)*((ro/2)*(r-ro)^2+(1/3)*(r-ro)^3))/(R*T)), start=start, trace=TRUE) Bests. Walmes. ====== Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departam

Re: [R] Legend in lattice

2011-06-15 Thread Walmes Zeviani
s.numeric(da$z), col=1, key=list(points=list(cex=1:4, pch=1), text=list(levels(da$z)), columns=4)) Bests, Walmes. ====== Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) D

Re: [R] logistic growth model

2011-06-06 Thread Walmes Zeviani
ridiculas.wordpress.com/2011/04/09/metodo-grafico-interativo-para-valores-iniciais-em-regressao-nao-linear/ Bests. Walmes. ====== Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) D

[R] Use line break at scrip but avoid line break on graphics

2011-06-02 Thread Walmes Zeviani
uld like a plot result like this plot(1, main=" ") I remember once I saw a meta character like "\n" that avoid this breack line plot(1, main="\(?) ")

Re: [R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
Marc, Thank you very much. You gave exactly what I wanted. Bests. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W) Departamento de Estatística - Universidade

[R] xtable with conditional formatting using \textcolor

2011-06-01 Thread Walmes Zeviani
\{ 10.00 \} \\ \hline \end{tabular} #- desired result (lines omited to save space) #- 1 & a & \textcolor{red}{ 2.00 }

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
ttice) xyplot(value~Time|variable, data=x, layout=c(3,1), type="l", scales=list(y=list(relation="free"))) Walmes. ====== Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.45041

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
e') ##axis(4, col='blue', line = -4) axis(4, at=seq(0,0.12,0.02), col='blue', line = -4) mtext(side=4, text="label green", line=-2) ti <- axTicks(4) ti.delta <- diff(ti)[1] ti.expan <- seq(ti[1]-ti.delta, ti[length(ti)]+ti.delta, ti.delta) ti.expan axis(

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
27;) mtext(side=4, text="label green", line=2) par(new = TRUE) plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col = 'blue') axis(4, col='blue', line = -4) mtext(side=4, text="label green", line=-2) Walm

[R] Using deriv3() in a separated nonlinear regression model

2011-05-25 Thread Walmes Zeviani
l(x, A[tr], B[tr]), data = da, start = list(A = c(10, : fator de passos 0.000488281 reduzido abaixo de 'minFactor' de 0.000976562 # That indicates th

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
quot;), value=runif(5, min= 0.5, max=1)) barchart(value~Detail|Main, data=dataset, scales=list(x=list(relation="free"))) Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geo

Re: [R] Adjusted Rate Ratios in R

2011-05-25 Thread Walmes Zeviani
Matthew, You can change the matrix (restriction) involved. Start from help(contr.sum) to know how specify this. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
Victor, I agree with Marc's point of view. So, if you can use another representation of you data, like points, considering looking at http://lmdvr.r-forge.r-project.org/figures/figures.html figures 10.20 and 10.21 for a start point. W

Re: [R] ternary contour plot

2011-02-15 Thread Walmes Marques Zeviani
- # draw an arrow with the coordinates extracted arrows(id$x[1], id$y[1], id$x[2], id$y[2]) #------ At your disposal. Walmes. ==== Walme

Re: [R] using the design matrix to correctly configure contrasts

2010-06-02 Thread Walmes Zeviani
="")), rep=1:4) eta <- model.matrix(~A*B, da)%*%matrix(c(0, 1,2, -1,0,1, 0,1,2, 0,0,0)) da$y <- rnorm(da$A, mean=eta, sd=1) g0 <- lm(y~A*B, data=da) anova(g0) require(contrast) c0 <- contrast(g0, list(B="B1", A=&quo

Re: [R] splitting a factor in an analysis of deviance table (negative binomial model)

2010-05-28 Thread Walmes Zeviani
51 44.357 0.59629 B.A4 3 9.284448 35.073 0.02574 * --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > Walmes. - ..ooo0 ... ..()... 0ooo...

Re: [R] Is possible a mini-plot into a big plot with Lattice?

2010-05-26 Thread Walmes Marques Zeviani
Mr. Murrell, It is exactly what I want. Thanks very much. Walmes. > Date: Thu, 27 May 2010 10:27:02 +1200 > From: p.murr...@auckland.ac.nz > To: walmeszevi...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] Is possible a mini-plot into a big plot with Lattice? >

[R] Is possible a mini-plot into a big plot with Lattice?

2010-05-26 Thread Walmes Marques Zeviani
Hello, I want to do with Lattice functions (qqmath, histogram) a figure like this below. n <- 1000 x <- rnorm(n) qqnorm(x); qqline(x) op <- par(fig=c(.02,.5,.5,.98), new=TRUE) hist(x, xlab="", ylab="", main="", axes=FALSE) box() par(op

Re: [R] nls() and nls2() behavior?

2010-05-11 Thread Walmes Zeviani
‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.1331 on 11 degrees of freedom Number of iterations to convergence: 1 Achieved convergence tolerance: 2.713e-07 I don't know abou nls2(). Walmes. - ..ooo0 ..

Re: [R] NLS "Singular Gradient" Error

2010-04-28 Thread Walmes Zeviani
ed convergence tolerance: 6.673e-07 > Bests. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experimentation \_)...

Re: [R] basic table statistics

2010-04-24 Thread Walmes Zeviani
y(val, ty, basicStats))) rownames(result) <- nam result Bests. - ..ooo0 ....... ..()... 0ooo... Walmes Zeviani ...\..(.(.)...

Re: [R] using nls for gamma distribution (a,b,d)

2010-04-15 Thread Walmes Zeviani
5, 1, 2), 0, 20) da <- data.frame(x=1:20) da$z <- gammafun(da$x, 5, 1, 2)+rnorm(da$x,0,1) plot(z~x, da) curve(gammafun(x, 5, 1, 2), add=TRUE) n1 <- nls(z~gammafun(x, alpha, B, b), data=da, start=list(alpha=5, B=1, b=2)) Sincerel

Re: [R] predict.lm with NAs

2010-04-15 Thread Walmes Zeviani
ata=da) # NA predicted Sincerely. Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Exp

Re: [R] mouse-clicking on xy-plot

2010-04-02 Thread Walmes Zeviani
You can use identify() to obtain coordinates from plotted points but if you want any coordinates you could use locator(): > plot(1:10) > loc <- locator(n=3) > str(loc) List of 2 $ x: num [1:3] 2.3 5.4 8.29 $ y: num [1:3] 6.15 8.33 2.6 > points(loc$x, loc$y, col=2) > Wal

Re: [R] Line Graph Labels

2010-04-01 Thread Walmes Zeviani
ow(da):(nrow(da)-5))], pos=rep(c(1,3), each=num))) Hope that helps. Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistic

Re: [R] Line Graph Labels

2010-04-01 Thread Walmes Zeviani
You can adapt the following example da <- data.frame(y=rnorm(50), x=1:50) plot(y~x, data=da) abline(h=c(-2,2), lty=3) with(da, text(x[abs(y)>2], y[abs(y)>2], label=x[abs(y)>2], pos=2)) Walmes.

Re: [R] lattice: how to add points to the plot generated by levelplot()?

2010-03-31 Thread Walmes Zeviani
l=function(...){ panel.levelplot(...) grid.points(runif(100,0,10), runif(100,0,10), pch=2) } ) Walmes - ..ooo0 ... ..(...

Re: [R] Expected pairwise.student.t and TukeyHSD behavior?

2010-03-24 Thread Walmes Zeviani
ance matriz m0 <- aov(y~A, da) vcov(m0) TukeyHSD(m0) # no problem! Walmes. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)...

Re: [R] testing parallelism of does-response curves using package "drc"

2010-03-17 Thread Walmes Zeviani
art=list(A=c(9,10), B=c(12,12))) n1 <- nls(y~A*x/(B[trat]+x), data=da, start=list(A=c(9.5), B=c(12,12))) anova(n1,n0) Look at gnls() function in the nlme package for a easier way to specify the model. Walmes Zeviani

Re: [R] confidence intervals for non-linear regression

2010-03-14 Thread Walmes Zeviani
In the paste I had provided one possible solution to this, see http://n4.nabble.com/Confidence-intervals-nls-td1556487.html#a1556702 Walmes. - ..ooo0 ... ..()... 0ooo

[R] R algorithm for maximum curvatures measures of nonlinear models

2010-03-05 Thread Walmes Marques Zeviani
calculation with real data (but not so trivial) that can able me to create my functions? Thanks a lot. Walmes Zeviani. Bates; Hamilton; Watts. Calculation onf intrinsic and parameter-effects curvatures for nonlinear models. Communications in statistics - simulations and computation, 469-477, 1

Re: [R] Correct nested design for GLM

2010-03-03 Thread Walmes Zeviani
#x27;t are used. da <- expand.grid(A=factor(1:3), B=factor(1:3))[rep(1:9, 3),] da$y <- rnbinom(da$A, size=10, prob=0.5) m1 <- glm.nb(y~A*B, data=da) anova(m1) m2 <- glm.nb(y~A/B, data=da) anova(m2) m3 <- glm.nb(y~A*B+(A/B), data=da) anova(m3) B

Re: [R] help with lattice boxplots...

2010-03-01 Thread Walmes Zeviani
la=list(lty=1, col="black")) ) Sincerely. Walmes Zeviani. Lavras - MG, Brasil. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Ma

Re: [R] Normality in split-plot design

2010-02-22 Thread Walmes Zeviani
TAT. You will welcome. Bests. Walmes Zeviani. Lavras, MG, Brasil. - ..ooo0 ... ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics

[R] How get the single bar x coordinate in barchart when groups is used?

2010-02-20 Thread Walmes Marques Zeviani
panel.text(x+c(-d,0,d), y, label=y, pos=3) }) Thanks in advance. Walmes Zeviani, Lavras - MG, Brasil. _ os. dium=Tagline&utm_campaign=InfuseSocial [[altern

[R] How to provide a result from D(f(x), "x") to a curve(f'(x)) ???

2010-02-17 Thread Walmes Marques Zeviani
))) curve(noquote(as.character(as.expression(D(expression(x^3), "x") Thanks in advance. Walmes Zeviani, Brasil. _ Quer deixar seus vídeos mais divertidos? Com o Movie Maker is

Re: [R] Triangular filled contour plot

2010-02-16 Thread Walmes Zeviani
2, sqrt(3)/2, label="cross", pos=3) panel.text(1, 0, label="resin", pos=4) trellis.unfocus() http://n4.nabble.com/file/n1557735/one.png I think (and hope :-) ) Deepayan Sarkar will implement this on Lattice soon because R doesn't h

Re: [R] HELP on Non-Linera Mixed-Effect model

2010-02-16 Thread Walmes Zeviani
d use loess() or locfit() in locfit library. Walmes - Brasil. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricul

Re: [R] Confidence intervals nls

2010-02-15 Thread Walmes Zeviani
1, function(x) sum(vcov(model)*outer(x,x # plot --- matplot(days, predict(model,list(DOY = days))+ outer(se.fit, qnorm(c(.5, .025,.975))), type="l", col=c(1,2,2), lty=c(1,2,2)) #-----

Re: [R] problem with "nls" function

2010-01-25 Thread Walmes Zeviani
) summary(m0) At your disposal. Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricultural Experi

Re: [R] About LU decomposition in R

2010-01-23 Thread Walmes Zeviani
Read the Matrix package documentation require(Matrix) help(lu, html=TRUE) Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in

Re: [R] confidence intervals for mean (GLM)

2010-01-22 Thread Walmes Zeviani
distribute.type=TRUE, type=c("p","a")) Explore the documentation and examples showed there. At your disposal. Walmes. - ..oooO .. ..()... 0ooo...

Re: [R] Model

2010-01-19 Thread Walmes Zeviani
Jim, Did you read the posting guide? Did you do a google search, for example, with terms like "[R] generalized linear models", "[R] count models", "[R] poisson regression"? I think you sho

Re: [R] Remove term from formula for predict.lm

2010-01-19 Thread Walmes Zeviani
a=new)[1:5] At your disposal. Walmes. - ..oooO .. ..()... 0ooo... Walmes Zeviani ...\..(.(.)... Master in Statistics and Agricult

Re: [R] Hierarchical Linear Model using lme4's lmer

2010-01-16 Thread Walmes Zeviani
Doug, It appears you are mixing nlme and lme4 formulation type. On nlme library you type lme(y~x, random=~1|subjetc) On lme4 library you type lmer(y~x+(1|subject)) You mixed them. At your disposal. Walmes. Doug Adams wrote: > > Hi, > > I was wondering: I've got a datas

Re: [R] Barchart bar lengths not proportionate

2010-01-14 Thread Walmes Zeviani
ylim=c(0, 1.05*max(da$y))) At your disposal. Walmes. Rex C. Eastbourne wrote: > > When I use barchart (with default formatting options), I get bars whose > lengths/heights are not proportional to their value. For example: > > http://drop.io/wbagm6s/asset/capture-png &g

Re: [R] Adding a distance scale to a plot?

2010-01-04 Thread Walmes Zeviani
contained, reproducible code. > > JustADude, Take a look at help documentation of spplot() function on the sp package. This function offer the scale mark on the plot. - ..oooO ..

Re: [R] multivariate group means

2010-01-04 Thread Walmes Zeviani
vide commented, minimal, self-contained, reproducible code. > > Ondra, Look at kmeans() procedure (help(kmeans)). I think this is what you're looking for. - ..oooO ...... ..()... 0ooo.

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Walmes Zeviani
e commented, minimal, self-contained, reproducible code. > > Adam, A segmented linear model, for estimation purposes, is a nonlinear model. It requires a iteractive procedure for estimation of fixed effects. You could use nlmer() for this. Walmes Zeviani, Lavras - MG, Brasil

Re: [R] Trellis Plot

2009-11-24 Thread Walmes Zeviani
x27;black', pos=2) trellis.unfocus() trellis.focus('strip', 2, 1, highlight=FALSE) ltext(0,.5,'30',col='red', pos=4) ltext(1,.5,'20',col='black', pos=2) trellis.unfocus() trellis.focus('strip', 1, 2, highlight=FALSE) ltext(0,.5,'4&#

Re: [R] Titles on lattice colorkey

2009-11-02 Thread Walmes Zeviani
g guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > Maybe using library(grid) we can solve. Try levelplot(z~x*y, grid, cuts = 50, scales=list(log="e"), xlab="", ylab="&

Re: [R] superscript in ylab

2009-10-29 Thread Walmes Zeviani
Try ylab=expression(Temperature*degree*C)) type demo(mathplot) at R prompt for more customizations. Walmes Zeviani Lavras - MG, Brasil. Lathouri, Maria wrote: > > Dear all > > I am doing some plots in R. > > I want to have as label in y-axis Temperature (oC).