[R] skewness: generating distribution and estimating M3.

2007-11-20 Thread Milton Cezar Ribeiro
Dear all, How can I generate values which distrituions have left or rigth skewness. After that, which function compute the skewness of each distributions? Kind regards. miltinho para armazenamento! [[alternative HTML version deleted]] __

[R] updating matrix from a dataframe

2007-11-23 Thread Milton Cezar Ribeiro
Dear all, I have a matrix which values varying from 1 to 5. I also have a table with a column that match with matrix values (=my.id). my.matrix<-matrix(sample(1:5,100,replace=T),nc=10) image(my.matrix) my.df<-data.frame(cbind(my.id=1:5,my.value=c(0.1,0.3,0.2,0.9,1))) my.df How can I create a ne

[R] Power model in R

2007-11-28 Thread Milton Cezar Ribeiro
Dear all, How can I fit a power model in R. Thanks in advance, miltinho para armazenamento! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] fitting "power model" in nls()

2007-12-02 Thread Milton Cezar Ribeiro
Dear all, I am still fighting against my "power model". I tryed several times to use nls() but I can´t run it. I am sending my variables and also the model which I would like to fit. As you can see, this "power model" is not the best model to be fit, but I really need also to fit it. The model

[R] Res: fitting "power model" in nls()

2007-12-02 Thread Milton Cezar Ribeiro
addition, there are other variables which are beeing tested as explanatory. Kind regards, miltinho - Mensagem original De: Gabor Grothendieck <[EMAIL PROTECTED]> Para: Milton Cezar Ribeiro <[EMAIL PROTECTED]> Cc: R-help <[EMAIL PROTECTED]> Enviadas: Domingo, 2 de Dezembr

[R] Res: fitting "power model" in nls()

2007-12-02 Thread Milton Cezar Ribeiro
Joerg van den Hoff <[EMAIL PROTECTED]> Para: Milton Cezar Ribeiro <[EMAIL PROTECTED]> Cc: R-help <[EMAIL PROTECTED]> Enviadas: Domingo, 2 de Dezembro de 2007 17:26:23 Assunto: Re: [R] fitting "power model" in nls() On Sun, Dec 02, 2007 at 11:08:01AM -0800, Milton Cezar Ri

[R] spliting windows 5 frames.

2007-12-08 Thread Milton Cezar Ribeiro
Dear all, I need split the output windows into two "frames" of equal size. On first frame I will print only a image, and on second frame I will print out for graphs (like those automaticaly generated by plot of a glm model. Below follow a visual which I looking for. x11(width=10,height=8) oldp

[R] adjusting "levels" after subset a table

2007-12-08 Thread Milton Cezar Ribeiro
Dear all, I have a data.frame with a factor collumn with about 10 levels. After extract a subset of this data.frame, by selecting 2 of my 10 levels, the new data.frame continue with original number of levels. How can I adjust it in a manner that when I try levels(my.df) I receive the actualyzed

[R] spatstat questions

2007-12-09 Thread Milton Cezar Ribeiro
Hi all, Is there a mailing list for spatstat R package? Another question: Can I find some ebooks on Spatial Pattern Analysis to be downloaded? Finally, how can I use a shapefile as "mask" on spatstat? I read the polygon using maptools::read.shape function and now I would like to use this shape

[R] Markov Chain Monte Carlo (MCMR) in R for spatial simulation.

2007-12-11 Thread Milton Cezar Ribeiro
Dear all, I would like to know if is there some MCMR capability (functions) develped to improve spatial explicit landscape simulations in R. Kind regards, miltinho Brazil. para armazenamento! [[alternative HTML version deleted]] __ R-he

[R] Enc: Res: How to plot the grid figure using R?

2007-12-11 Thread Milton Cezar Ribeiro
Dear Jian, I would like help you but I need that you explain a little bit about what you really want. Sorry ask you again, but may be I don´t understood because my difficulties on english. Anyway, try this: require(akima) x=runif(100,0,100) y=runif(100,0,100) dbh=runif(100,1,100) rdata=d

[R] reading data on code script.

2007-12-16 Thread Milton Cezar Ribeiro
Dear All, It there a way of I read my data tab-separated on the own script, without read from a external file and without type the data? I would like something like mydata<- read.data(head=T, sep="\t") freqesperado 117.5 147.5 47.5 17.5 ##END OF DATA Many thanks, miltinho para armazenamen

[R] polar orientation significance test

2007-12-16 Thread Milton Cezar Ribeiro
Hi there, I would like to test if are there some significant orientation of frequencies on a polar analysis. my data looks like: mydata<-"angule,frequency 22.5,6 67.5,3 112.5,2 157.5,2 202.5,3 247.5,3 292.5,6 337.5,5" mydata.tab<-read.table(textConnection(mydata), header = TRUE,sep=",") require

[R] Res: convert table

2007-12-17 Thread Milton Cezar Ribeiro
Ciao Giovanni, Try this. x<-matrix(sample(0:4,25,replace=T),nc=5) x x[x>0]<-1 x Miltinho uno capoeirista brasiliano - Mensagem original De: giovanni bacaro <[EMAIL PROTECTED]> Para: [EMAIL PROTECTED] Enviadas: Segunda-feira, 17 de Dezembro de 2007 14:03:34 Assunto: [R] convert table D

[R] Res: Scatterplot Showing All Points

2007-12-17 Thread Milton Cezar Ribeiro
Hi Wayne, I have two suggestion to you. 1. You add some random noise on both x and y data or 2. You graph bubble points, where the size is proportional to the frequence of the xy combination. x<-sample(1:10,1,replace=T) y<-sample(1:10,1,replace=T) xy<-cbind(x,y) x11(1400,800) par(mfrow=c

[R] continue a for() when occurs errors

2007-12-20 Thread Milton Cezar Ribeiro
Dear all, I am simulating some regressions in a for() looping and sometimes occours some error and the R stop my batch processing. I would like do save the step where the error happned and continue my for() looping. Is there a way to do that? Thanks In Advance. Miltinho para armazenamento!

[R] collapsing a list in a var.

2007-12-20 Thread Milton Cezar Ribeiro
Dear all, I have a object like my.obj<-c("a1","a2","a3") and I would like my.new.obj="a1 a2 a3". I tryed to do my.new.obj<-paste(my.obj,sep=" ") but it return three entries and I need only one entry as result. Any idea? Miltinho Brazil. para armazenamento! [[alternative HTML versi

[R] predicted mle() values.

2007-12-20 Thread Milton Cezar Ribeiro
Dear all, I am comparing two regression models, one by nls() and other by mle() packages. I know how do plot the estimated values using curve() function, but I need the predicted to use on other functions and I don´t know how do get the predicted value my mle model. Any help are welcome. mil

[R] updating R version and packages.

2007-12-30 Thread Milton Cezar Ribeiro
Dear All, Is there a way of I update automatically the R version and the respective packages which I have installed on my computer? Case not, how can I know about what packages I installed by my self on the computer? All have a nice new year. from miltinho, Brazil. para armazenamento!

[R] redirect plot device automatically

2008-01-03 Thread Milton Cezar Ribeiro
Dear all, Every time that I need to generate I plot output as figure I use something like png("myoutput.png") plot(rnorm(100)*1.0,col=4) points(rnorm(100)*0.5,col=2,pch=0) dev.off() But now I need to generate a lot of outputs and it could not be done in a for looping where I can change the name

[R] Confidence Inteval for regression curve.

2008-01-05 Thread Milton Cezar Ribeiro
Dear all, I have a dataset which I need to estimate the regression model and plot the estimated curve two other curves with low and high confidence interval (CI=95%). How can I do that? x<-1:100 y<-x^0.2+rnorm(100,0.1,0.1) mod<-glm(y~log(x)) plot(y~x) lines(predict(mod)~x,col=2) Kind regards,

[R] clipping a large image on R

2008-01-11 Thread Milton Cezar Ribeiro
Dear all, I have a so large image (43,000 x 18,000 pixels) and I need clip this image with a smallest one (1000x1000 pixels). I can read the second image using rgdal package. But the first image can´t be read on my system because if memory limitation (I have about 2GB availabe). So I would li

[R] haralick tetures on Biocon/EBImage

2008-01-11 Thread Milton Cezar Ribeiro
Dear all, Following a suggestion by Henrik Bengtsson I installed EBImage/biocondutor package. I also installed ImageMagick and GTK software because EBImage need it. After look at EBImage I find a function that compute Haralick texture on images. I tryed to run it with following simulated image,

[R] Res: vector generation

2008-01-17 Thread Milton Cezar Ribeiro
hi Juan, It is not so elegant, but work fine. I know that our colleagues can do it on a simple line. z<-c(526,723,110,1110,34,778,614,249,14) v1<-NULL v2<-NULL for (i in 1:(length(z)-1)) { for (j in i:length(z)) { v1<-rbind(v1,z[i]) v2<-rbind(v2,z[j]) } } df<-data.frame(cbind(v1=v1,v2=v2)) nam

[R] Res: Leyenda (revisited translation)

2008-01-18 Thread Milton Cezar Ribeiro
(just tranlating...) (i made a little mistake on last on / miltinho). Hi, I am trying to put the legend on the outside of plot region. How can I do that? My code looks like... df<-read.table(stdin(),head=T,sep=",") row,LENGTH,LAT 091639,10.002,42.26282 091640,30.808,42.26834 091641,21.591,42.3

[R] Res: Leyenda

2008-01-18 Thread Milton Cezar Ribeiro
(just tranlationg...) Hi, I am trying to put the legend on the outside of plot region. How can I do that? My code looks like... df<-read.table(stdin(),head=T,sep=",") row,LENGTH,LAT 091639,10.002,42.26282 091640,30.808,42.26834 091641,21.591,42.31689 091642,22.030,41.53246 091643,22.744,42.01954

[R] Res: distance matrix

2008-01-20 Thread Milton Cezar Ribeiro
Like this? my.points<-data.frame(cbind(x=c(1,10,50,100,1,20,10,100),y=c(1,5,20,50,100,1,1,10))) rownames(my.points)<-paste("pt",1:8,sep="") plot(my.points) text((my.points+2),rownames(my.points),col="red") require(vegan) my.points.dist<-vegdist(my.points,method="euclidean") my.points.dist kind re

[R] moving window over a matrix.

2008-01-21 Thread Milton Cezar Ribeiro
Dear all, I have a set of matrix and I need to compute several measures on source image and to generate other matrices, in a moving window way. My input images have integer and double precision values, and also NAs. I need to compute some measures that I will define as functions (like the samp

[R] Res: predict from a multiple regression model

2008-01-22 Thread Milton Cezar Ribeiro
Hi Franzi, Up to I know you can´t predict values without you have x2,x3 and x4 parameters. So you have three possible solution 1) set x2, x3 and x4 to Zero, *but* it will depend so much of what you want, because if you set them to zero, it means that you are adjusting something like mod<-lm(y~

[R] Res: image question

2008-01-23 Thread Milton Cezar Ribeiro
Like this? mymat<-matrix(1:1,nc=100) for (nc in 1:dim(mymat)[2]) mymat[nc,]<-nc image(mymat,col=colors()) Miltinho Brazil - Mensagem original De: Ajar <[EMAIL PROTECTED]> Para: R-help@r-project.org Enviadas: Quarta-feira, 23 de Janeiro de 2008 18:36:59 Assunto: [R] image question

[R] Res: image question

2008-01-23 Thread Milton Cezar Ribeiro
Like this? mymat<-matrix(1:1,nc=100) for (nc in 1:dim(mymat)[2]) mymat[nc,]<-nc image(mymat,col=colors()) Miltinho Brazil - Mensagem original De: Ajar <[EMAIL PROTECTED]> Para: R-help@r-project.org Enviadas: Quarta-feira, 23 de Janeiro de 2008 18:36:59 Assunto: [R] image question

[R] polygon spanning tree

2008-02-03 Thread Milton Cezar Ribeiro
Dear all, I have a set of shapefiles which contents are polygons. I would like to know if is there a way of I obtain the links between the polygons, something like a "polygon spanning tree". For point patterns I can use de spatstat package, but I need to do it for polygons. Below I send a sampl

[R] how to get points from SpatialPolygonsDataFrame

2008-02-03 Thread Milton Cezar Ribeiro
Dear all, I need to get all points for each polygons and save these points in a data.frame. I tryed to use the slot() function, but I can´t access the "coords". grd <- GridTopology(c(1,1), c(1,1), c(10,10)) polys <- as.SpatialPolygons.GridTopology(grd) centroids <- coordinates(polys) x <- cen

[R] identifying lines that cross polygons.

2008-02-04 Thread Milton Cezar Ribeiro
Dear All, I have a shapefile wich contents are polygons. I sort two (here random) points and I would like to identify if the line built with this two points cross or not polygons and in case yes, which polygons were crossed. I tryed to figure out the problem with a sample code got from sp/mapto

[R] Res: How to set working directory to a fixed map?

2008-02-05 Thread Milton Cezar Ribeiro
Hi Kes May be this help: setwd("c:\\temp\\mydir") you can also change by setwd("c:/temp/mydir") Best wishies Miltinho Brazil - Mensagem original De: Falco tinnunculus <[EMAIL PROTECTED]> Para: r-help@r-project.org Enviadas: Terça-feira, 5 de Fevereiro de 2008 9:26:18 Assunto: [R]

[R] Res: gc() and memory efficiency

2008-02-06 Thread Milton Cezar Ribeiro
Dear Harold, I had the same problem some times ago. I noticed that after I run a set commands (cleaning all non-usefull variables) for 5 times, the system broken-down. I solved it building several scritpsNN.R and call them in a .BAT DOS file. It worked so fine, almost in my case, and the comput

[R] Res: GLM coefficients

2008-02-07 Thread Milton Cezar Ribeiro
Hi Joseph, have you tryed coef(model) ? Kind regards, Miltinho - Mensagem original De: "Munyandorero, Joseph" <[EMAIL PROTECTED]> Para: r-help@r-project.org Enviadas: Quarta-feira, 6 de Fevereiro de 2008 12:06:36 Assunto: [R] GLM coefficients Dear all, After running a glm, I use the

[R] Res: time series plot

2008-02-07 Thread Milton Cezar Ribeiro
Olá Ana May be it help you abline(v=as.Date("2008/3/1"),lty=3,col=3) Kind regards Miltinho - Mensagem original De: Ana Quitério <[EMAIL PROTECTED]> Para: r-help@r-project.org Enviadas: Quarta-feira, 6 de Fevereiro de 2008 20:41:25 Assunto: [R] time series plot Dear all. I want to ad

[R] shortest distance between two point pattern

2008-02-08 Thread Milton Cezar Ribeiro
Hi R-experts. I am working in a R-code where I have two datasets with x and y coordinates on each dataset. I intent to identify the shortest distance between this two datasets. I wrote a short code to do that. But when I join the datasets to compute the distances, the merge function run so slo

[R] attribing frequency of "levels" to each matrix cell

2007-11-10 Thread Milton Cezar Ribeiro
Hi R-gurus, I have a matrix which looks like 000 0111220 0111220 0111000 000 As you can see we have non-zero levels 1 and 2. I would like to fill an other matrix with the frequency of non-zero levels in each cell. The results that I need is 000 0999440