[R] Something weird

2016-06-03 Thread Juan Andres Hernandez
Can anybody explain me this weird result? a=3 as.integer(a) 1] 3 a=(3/10)/0.1 a [1] 3 as.integer(a) [1] 2 Thank's in advance Juan A Hernández [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mor

[R] How to F noncentrality parameter

2015-02-10 Thread Juan Andres Hernandez
Does anybody know how to calculate noncentrality parameter for a three way interaction? It is easy for a two way interaction, but I can't find the way to do it with a three way. I have been looking for a packages about this, but it seems that none manages to do this. Thank's in advance Juan Hernan

[R] How to extract table results from survival summary object

2014-10-07 Thread Juan Andres Hernandez
Hi. I need to extract the "matrix" or "data.frame" results from a survival object. library(survival) data(lung) mod=with(lung, survfit(Surv(time,death)~ 1)) res=summary(mod) res show in consola the "matrix" I am looking for, but I can't find the way to save or assign this table to an object. Anyo

[R] How to extract convergence code from lmer object?

2014-07-04 Thread Juan Andres Hernandez
Does anyone know how to extract the convergence code of an lmer object. I am working in a monte carlo simulation with mixed model and I need to know if a model has or not convergence. With unclass(mymodel) the following information attr(,"optinfo")$conv$lme4 can be seen. How can I get this importan

[R] How to print something in the same location in console?

2014-06-12 Thread Juan Andres Hernandez
Hi I need to print the iteration number of a procedure but in the same location in console. Using cat with or without fill argument does not produce the desired outcome. Does anybody know how to get it?. for(i in 1:10) cat('Iteration:',i,fill=T) Thank's in advance Juan A. Hernandez [[alt

[R] barplot to the right side

2013-09-30 Thread Juan Andres Hernandez
Hi, does anybody know how to get a barplot with the x axis starting in the right side and the y axis in the right side too? An example: dat=c(2,4,0,6,5) names(dat)=paste('dpt.',1:5,sep='') barplot(dat, horiz=T) box() I need this barplot in mirror, with the zero value to 6 starting in the right si

[R] How to stop a loop for?

2012-02-08 Thread Juan Andres Hernandez
Hi all, I have some time trying to find a way to stop a loop for( ) until the user presses the enter key or any other one and the loop can continue. This could be an example: library(MASS) data <- data.frame(mvrnorm(1000,rep(0,5),Sigma=diag(1,5))) for(i in 1:dim(data)[2]){ plot(density(data[,

[R] How to export to pdf in landscape orientation?

2011-06-25 Thread Juan Andres Hernandez
Does anybody know how to get a pdf file with landscape orientation?. pdf(file= 'my_file.pdf' ,onefile=T,paper='A4') plot(sin, -pi, 2*pi) dev.off() Thank's in advance Juan A. Hernandez Spain [[alternative HTML version deleted]] __ R-h

[R] how to access the elements of a univariate results table with Anova (library car)

2011-03-19 Thread Juan Andres Hernandez
Dear R users, I use the excelent Anova function of the library car because the easy way to get sphericity correction. Unless I use the scan function. I have not been able to access the values ​​of sum squares and degrees of freedom for each effect in the univariate summary table. Example of t

[R] How to xyplot without borders

2011-01-27 Thread Juan Andres Hernandez
Hello I have the following data.frame and xyplot. I need this plot without the borders. Does anybody know how to get this xyplot without borders o with white borders? Thank's in advance Juan Hernández my.label <- data.frame(quantil=rep(20,8), my.factor=factor(c('FA','FB','FC','FD','FE','FG','FH',

[R] How to carry out a hierarchical cluster analysis

2011-01-24 Thread Juan Andres Hernandez
I would appreciate any information about how to carry out a hierarchical cluster analysis with cluster of subjects. I need to find cluster of subjects that share many variables. I know that fcp package have a lot of options to carry out the regular hierarchical cluster analysis (cluster of variable