Re: [R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread milton ruser
Hi (sorry, I don´t got your name) May be this help you. trap$time<-factor(trap$time) trap$block<-factor(trap$block) All the best, miltinho astronauta brazil On 7/19/08, hpdutra <[EMAIL PROTECTED]> wrote: > > > Hi everyone. I am trying to add a formula to my data using the > groupedData >

[R] estimating volume from xyz points

2008-07-19 Thread milton ruser
Dear all, I have several sets of x-y-z points and I need to estimate the volume that encompass all my points. Recently I got some adivice to show the "convex hull" of my points using geometry package (see code below). But now I need to calculate the volume of my set of points. Any advice are wellc

Re: [R] How to filter a data frame?

2008-07-22 Thread milton ruser
May be this help you; Just intall.packages("sqldf", dependencies=T) require(sqldf) my_df<-data.frame(cbind(gender=sample(c("male","female"),50,replace=T), age=round(rnorm(50, mean=30, sd=5),0))) my_df_subset_male<-sqldf("select * from my_df where gender=='male'") my_df_subset_male my_df_subset_

Re: [R] an extremely simple question

2008-07-22 Thread milton ruser
Hi Edna, I am not sure the completely right answer, but I suspect that you use data(df) to invoke a data.frame from the sample datasets provided from the packages available on your R system. By other side, if you have a data.frame loaded on your environent, you can use "attach" do turn the columns

Re: [R] Can't Load Text Files

2008-07-22 Thread milton ruser
setwd("c:\\temp") #you need to insert a ENTER after your last value > df1<-read.table("testinput.txt", head=T, sep="\t") > df1 Date France Germany 1 3/15/07 1 2 2 3/10/07 2 4 > df2<-read.table("testdate.txt", head=T, sep="\t") > df2 Date 1 3/15/07 2 3/14/07 3 3/13

Re: [R] Using if, else statements

2008-07-23 Thread milton ruser
Hi Rob Williams I think it is one way of you do the job. Cheers, miltinho astronauta brazil my.df<-data.frame(cbind(data=sample(c("mon","sat","sun"), 20, replace=T), values=rnorm(20))) my.df$values<-as.numeric(my.df$values) data.weigth<-read.table(stdin(), head=T, sep=",") data,weigt

Re: [R] Using if, else statements

2008-07-23 Thread milton ruser
Just to clarify, if you have two data.frame, one with your data, other with data-admissions, just use data.merge<-merge(my.df, data.weigth, by.x="data", by.y="data", all=T) miltinho On 7/23/08, milton ruser <[EMAIL PROTECTED]> wrote: > > Hi Rob Williams >

Re: [R] Histogram

2008-07-23 Thread milton ruser
I don´t know what you means by "treat", but may be you want something like my.df<-read.table(stdin(), head=T, sep=",") class,frequency 20-23,9 23-25,7 26-28,5 29-31,5 32-34,3 rownames(my.df)<-my.df$class barplot (my.df$frequency) axis(1, 1:dim(my.df)[1], rownames(my.df)) Cheers, miltinho astronau

Re: [R] sum each row and output results

2008-07-23 Thread milton ruser
Like This? my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890

Re: [R] Sample on dataframe

2008-07-23 Thread milton ruser
I hope this helps my.df<-read.table(stdin(), head=T, sep=" ") V5 V5.1 V5.2 V5.3 V5.4 V5.5 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.718

Re: [R] Histogram

2008-07-23 Thread milton ruser
quot;, "mean_v1", "mean_v2", "rm2", "median_v1", "median_v2") my.stats On 7/23/08, Angelo Scozzarella <[EMAIL PROTECTED]> wrote: > > Thanks, but I want to calculate index like mean, median . > > > How can I d

Re: [R] How to preserve the numeric format and digits ?

2008-07-24 Thread milton ruser
Like this? options (scipen=100) m <- c(4, 500) paste("A", m, "B", sep="") Regards, Miltinho astronauta brazil On 7/24/08, Daren Tan <[EMAIL PROTECTED]> wrote: > > > Instead of > > > m <- c(4, 500) > > paste("A", m, "B", sep="") > [1] "A4e+08B" "A5e+10B" > > I wa

Re: [R] Insert rows into a pre-existing data frame

2008-07-25 Thread milton ruser
Hi "somebody" I hope this helps: df1<-data.frame(cbind(va=runif(3), vb=runif(3))) df1 df2<-data.frame(cbind(va=runif(3), vb=runif(3))) df2 df.blank<-data.frame(cbind(va=NA, vb=NA)) df.blank df.join<-rbind(df1, df.blank, df2) df.join Miltinho astronauta brazil On 7/25/08, [EMAIL PROTECTED

Re: [R] response surface analysis

2008-07-26 Thread milton ruser
Hi Jimsong, If I understood your point, give a look at "adehabitat" and "grasp" packages. Almost for adehabitat there are a demo for you see its functionality. Cheers, miltinho astronauta brazil On 7/26/08, Jinsong Zhao <[EMAIL PROTECTED]> wrote: > > Hi, > > Is there a package that could do res

[R] multiple separators in scan() functions

2008-07-30 Thread milton ruser
Dear all, Is there a way of I deal with more than one kind of separators when reading a asc file using scan() function? The separators could be ":", "\t" and ";". Kind regards miltinho [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] Reading data in R-metrics

2008-08-02 Thread milton ruser
John, I suspect that Patrick is right. send us a str(df) to we see how your data frame looks like kind regards miltinho astronaura brazil On 8/1/08, Kerpel, John <[EMAIL PROTECTED]> wrote: > > Hi Folks! > > > > I used the code below previously with no problems, but now I get: > > > > DTB3<-rea

Re: [R] Create data frame from header only

2008-08-04 Thread milton ruser
Hi Etienne It is not so elegant, bu I think that work. colname.list<-paste("A",1:5,sep="") df<-data.frame(matrix(matrix(rep(1,length(colname.list)),1),1)) df colnames(df)<-colname.list df df<-df[-1,] df Cheers, Miltinho Astronauta Brazil On 8/4/08, Etienne Bellemare Racine <[EMAIL PROTECTE

Re: [R] subsetting with column name as string

2008-08-06 Thread milton ruser
Try this foo1 = function(val) { return(d[val]) } foo1("x") Good luck miltinho astronauta brazil On 8/6/08, Faheem Mitha <[EMAIL PROTECTED]> wrote: > > > Hi, > > Consider the following > > x = c(1,2) >> y = c(3,4) >> d = data.frame(cbind(x,y)) >> d$x >> > [1] 1 2 > >> d$"x" >> > [1] 1

Re: [R] How Can I Tell if the R Running is 64 bit or 32 bit?

2008-08-08 Thread milton ruser
Dear Prof. B.Ripley, If : > .Machine$sizeof.pointer [1] 4 > 2*2*2*2 [1] 16 So I am running with 16 bits? How can I know the number of bits supported on my machine? Kindly, miltinho astronauta brazil On 8/8/08, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > > Look at .Machine$sizeof.pointer (i

Re: [R] aggregate

2008-08-08 Thread milton ruser
Dear Sherri Heck, Try something like: my.df<-read.table(stdin(), head=T, sep=",") doy,yr,mon,day,hr,hgt1,hgt2,hgt3,co21,co22,co23,sig1,sig2,sig3,dif,flag 244.02083,2005,09,01,00,2.6,9.5,17.8,375.665,373.737,373.227,3.698,1.107,0.963,-0.509,PRE 244.0625,2005,09,01,01,2.6,9.5,17.8,393.66,384.773,3

Re: [R] import/export txt file

2008-08-08 Thread milton ruser
Dear Alessando, I don´t know if I understood well your question, but my be you are not "losting" the precision. Try change the options(digits=10). If you want to output with "," as sepatator, try something like write.table(testground, "my_output.txt", sep=",", append=F, quote=F, row.names=F) but i

Re: [R] Anova

2008-08-12 Thread milton ruser
Dear Daniel, Are you really interested on the analyzis of the effect of ML on Grup, our on the effect of Grup on ML? I reproduce your sample database, but "changed" some Grup values from 1 to 2 to allow an analysis of variance. See the example below. Vale! miltinho astronaura Brazil GBM<-re

[R] changing plot font for Times new roman

2008-08-18 Thread milton ruser
Dear all, I know that it is a know issue, but I would like to change the type of font on my plot, and I am not sure the rigth way. I would like to use Times New Roman font, but according to the "par()" help, some device allow we choose an family of fonts. I tryed par(family="times") without succes

Re: [R] How to learn R language?

2008-08-27 Thread milton ruser
Dear Sagga, How give a look at the introduction material on Help / Manual (in pdf) / An introduction to R HTH miltinho astronauta brazil On 8/27/08, saggak <[EMAIL PROTECTED]> wrote: > > Hi! > > I am a post graduate in Statistics. I want to learn R language, but am very > confused as to how to

Re: [R] How to create additional columns?

2008-08-27 Thread milton ruser
Dear Kayj Try something like setwd("c:\\temp") require(MASS) my.df<-read.table("my_inputfile.txt", sep="\t", head=T) my.df$newcol<-my.df$col1+my.df$col2+my.df$col3 write.table(my.df, "my_outputfile.txt", append=F, row.names=F, sep="\t") On the above example, I suppose that your input file are

Re: [R] remove levels from a factor

2008-08-29 Thread milton ruser
Hi Yuan, It is not ellegant, but may work for you.. f<-as.factor(c("a","b","a")) f.freq<-data.frame(table(f)) f.freq lower.freq<-2 f.freq.subset<-subset(f.freq,f.freq$Freq>=lower.freq) f.freq.subset f.selected<-f[f %in% f.freq.subset$f] f.selected<-factor(f.selected) f.selected Best wishes,

Re: [R] generalized linear models

2009-08-07 Thread milton ruser
Hi Annie, create a new data.frame with input variables having all predictors variables on it. after give a look at ?predict best wishes milton On Fri, Aug 7, 2009 at 8:19 PM, annie Zhang wrote: > Hi, R users, > > I am trying to use glm to do logistic regression. I know generally when I > have

Re: [R] nearest neighbors

2009-08-09 Thread milton ruser
Hi cindy, depends on your data type. It it is points, give a look at spatstat package. bests milton On Sun, Aug 9, 2009 at 5:03 PM, cindy Guo wrote: > Hi, All, > > I am wondering if there is any package which can give the index of the k > nearest neighbors. > > Thank you, > > Cindy > >

Re: [R] paste first row string onto every string in column

2009-08-11 Thread milton ruser
Hi Jill, Completely not elegant, but may be usefull. Of course other colleagues will solve this with 1 line command :-) cheers milton df<-read.table(stdin(), head=T, sep=",") V1,V2,V3,V4 DPA1*,DPA1*,DPB1*,DPB1* 0103,0104,0401,0601 0103,0103,0301,0402 df.new<-as.matrix(df) for (i in 2:dim(df)[

Re: [R] How to label and unlabel points on scatterplot with mouse pointer

2009-08-11 Thread milton ruser
Hi Hitesh, while the rigth response not arrive, you can play with: id<-1:10 x<-runif(10) y<-runif(10) plot(x,y) identify(x, y , labels = id) Try give a look on spatstat help. I am not quite sure, but may be there you can find some solution (sorry if it is not true) cheers milton On Wed, Aug 1

Re: [R] cross tabulation for frequency distributions

2009-08-14 Thread milton ruser
Like this? age<-as.integer(sample(rnorm(100, mean=30, sd=10), replace=T)) height<-as.integer(1+age*rnorm(100,mean=1,sd=0.2)) plot(age, height) table(age,height) or freq=data.frame(table(age,height)) freq<-subset(freq,Freq>0) freq bests milton On Fri, Aug 14, 2009 at 5:02 AM, rajclinasia wrote

Re: [R] reading in mdb and outputting to sql (GIS application)

2009-08-14 Thread milton ruser
Hi Stephen, I have read .mdb files using RODBC package. Try give a look on it. bests milton On Fri, Aug 14, 2009 at 7:55 PM, stephen sefick wrote: > > library(Hmisc) > > # Read all tables in the Microsoft Access database blabla.mdb > > # perhaps better change to Locale in which the .mdb f

[R] run R codes every startup.

2009-08-16 Thread milton ruser
Dear all, how can I setup R(gui) to run some commands evertime R startup? cheers milton [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

Re: [R] Plot(x,y)

2009-08-18 Thread milton ruser
Hi malcolm, sorry but your post continue with pour quality, because it is not reproducible, it is!? By the way, gavin.simp...@ucl.ac.uk wrote: . You really shouldn't call your data, 'data' as it will get very confusing when you start using modelling functions and using the data argument, or u

Re: [R] print selected variables

2009-08-20 Thread milton ruser
Hi there, what you means by "complete data". Read the posting guide, where it is suggested a minimum reproducible code, as well as good clarification about what you have/get and what you realy want to get. bests milton On Thu, Aug 20, 2009 at 3:38 AM, rajclinasia wrote: > > Hi every one, > > I

Re: [R] hey

2009-08-22 Thread milton ruser
Try again. 0. read the posting guide. 1. giving a creative "subject title"; 2. sending a minimum reproducible code, example, etc. cheers milton On Sat, Aug 22, 2009 at 3:34 PM, Wang qiang wrote: > dear friends, > i am now working on a longitudinal data using R. all the analyses have been > do

Re: [R] dificult loop "for"

2009-08-23 Thread milton ruser
Hi gregorio, I think you can have nested for() without problem, like: for (i in sth : sth[length(sth)]) { for (k in A:B) { } } or you can build conditional for's like: rangeNegative<-1:10 rangePositive<-1:20 if (rnorm(1)>=0) MYRANGE<-rangePositive if (rnorm(1)<0)

Re: [R] latitude and longitude distribution

2009-08-25 Thread milton ruser
Hi there, How about you send a minimum reproducible code as suggested on posting guide :-) bests milton On Tue, Aug 25, 2009 at 5:48 AM, ogbos okike wrote: > Good day to you all, > I have lightning data containing date, time, latitude and longitude. I hope > that distribution of latitude and

Re: [R] How to create a random matrix

2009-08-25 Thread milton ruser
Like tris: NCols=5 NRows=7 myMat<-matrix(runif(NCols*NRows), ncol=NCols) myMat bests milton On Mon, Aug 24, 2009 at 6:17 PM, Peng Yu wrote: > Hi, > > I did a search but I was able to find how to generate a random matrix. > Can somebody let me know how to do it? > > Regards, > Peng > >

Re: [R] Autocorrelation and t-tests

2009-08-25 Thread milton ruser
Hi Bernardo, I suggest you give a look at: Dale MRT & Fortin MJ, 2009. Spatial Autocorrelation and Statistical Tests: Some Solutions. Journal of Agricultural, Biological and Environmental Statistics, 14(2):188-206. Cheers milton On Tue, Aug 25, 2009 at 1:08 PM, B Garcia Carreras < bernardo.garc

Re: [R] error matrix, cross table,

2009-08-25 Thread milton ruser
Hi Gustavo, depends on how your thematic maps are stored. Give a look on SPATIAL / CRAN at http://cran.r-project.org/web/views/Spatial.html If your data is raster-based, try to give a look on raster package. bests milton On Tue, Aug 25, 2009 at 7:20 PM, dalposso wrote: > > how to create a cro

Re: [R] Help regarding frequency distribution Graphs

2009-08-26 Thread milton ruser
Google "R gallery" :-) On Wed, Aug 26, 2009 at 7:32 AM, anupam sinha wrote: > Hi all, >I am trying to construct a frequency distribution graph i.e. > suppose there is a variable *"k"* and it takes a range of values. What I > want to do is to plot *"P(k)" *(probability/frequency of fin

[R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
Dear all, I have about 30,000 matrix (512x512), with values from 1 to N. Each value on a matrix represent a habitat patch on my matrix (i.e. my landscape). Non-habitat are stored as ZERO. No I need to change each 1-to-N values for the same random number. Just supose my matrix is: mymat<-matrix(c(

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
hink that if I put this on a for() looping it will be very time expensive, and as I have a lot of landscapes, I need to speed up it. Any suggestion? bests milton On Wed, Aug 26, 2009 at 1:12 PM, David Winsemius wrote: > > On Aug 26, 2009, at 12:53 PM, milton ruser wrote: > > D

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
sum ( x == i ) > , min = min > , max = max >) > } > x > } > milton ( x = mymat ) > > -- > David > > - > David Huffer, Ph.D. Senior Statistician > CSOSA/Washington, DC david.huf...@csosa.gov > -------

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
david.huf...@csosa.gov > ----- > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of milton ruser > Sent: Wednesday, August 26, 2009 1:18 PM &g

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
t; > From: r-help-boun...@r-project.org > > [mailto:r-help-boun...@r-project.org] On Behalf Of milton ruser > > Sent: Wednesday, August 26, 2009 9:54 AM > > To: r-help@r-project.org > > Subject: [R] changing equal values on matrix by same random number > > > > D

Re: [R] subset of a matrix

2009-08-27 Thread milton ruser
Hi Carlos, how about this step first: rownames(mydata)<-gsub("361a","00361a",rownames(mydata)) rownames(mydata)<-gsub("456a","00456a",rownames(mydata)) good luck milton On Thu, Aug 27, 2009 at 12:27 PM, Carlos Gonzalo Merino Mendez < carlosgmer...@yahoo.com> wrote: > Hello everyone, I would ap

Re: [R] subset of a matrix

2009-08-27 Thread milton ruser
Hi Carlos, I think I made a wrong suggestion. Sorry about that. I was thinking that if you have the same rowname length it helps you on the data handling. Is it true?! Case yes I can try suggest another automatic way of you get it. bests milton On Thu, Aug 27, 2009 at 12:39 PM, milton ruser

Re: [R] How to generate mean anova value row in anova table, instead of individual value for each predictor

2009-08-28 Thread milton ruser
Hi Moumita, Could you send a "minimum reproducible code" as suggested on posting guide?! bests milton On Fri, Aug 28, 2009 at 8:08 AM, Moumita Das wrote: > Hi All , > Can anybody tell me if there's any way to get the summarized anova > values.Now i will explain what i mean , when i say "*summa

Re: [R] new data.frame summed by date

2009-08-28 Thread milton ruser
Puting my 2cents: newDF<-data.frame(aggregate(X$PL_Pos, list(X$MyDate), sum)) colnames(newDF)<-c("MyDate","PL_Pos_SUM") good luck milton On Fri, Aug 28, 2009 at 1:03 PM, jim holtman wrote: > Is this what you want: > > > aggregate(X$PL_Pos, list(X$MyDate), sum) > Group.1x > 1 2009-08-0

Re: [R] Simple column selection question- which and character lists

2009-08-31 Thread milton ruser
Hi Allen, have you tryed: newDF<-sourceDF[,names.species.bio.18] This will create a new data.frame with only those species you have interest. By the way, your data.frame is called data? Case yes, avoid this, please. good luck milton On Mon, Aug 31, 2009 at 12:39 PM, AllenL wrote: > > Dear

Re: [R] numerical summaries across variables.

2009-09-01 Thread milton ruser
Hi here, may be you can play with reshape, or may be aggregate and reshape... good luck milton On Tue, Sep 1, 2009 at 2:17 AM, rajclinasia wrote: > > Hi Every one, > I have a dataframe "class" with "name", "sex", "age", "height", "Weight". > if i caluclate summary statistics with the below co

Re: [R] problem in loop

2009-09-02 Thread milton ruser
Hi there, and how about this: nsim<-500 est<-NULL for(i in 1:nsim){ fit <- geese(x ~ trt, id=subject, data=data_gee, family=binomial, corstr="exch", scale.fix=TRUE) . corr_gee<-summary(fit)$correlation[1] se_corrgee<-summary(fit)$correlation[2] est<-data.frame(rbind(est,cbind(corr_gee

Re: [R] (no subject)

2009-09-02 Thread milton ruser
Hi Karen. If you are running windows, try: http://cran.r-project.org/bin/windows/base/ Case it is Vista, see some tips on the same link. cheers milton On Wed, Sep 2, 2009 at 8:13 PM, Karen Federico wrote: > I'm trying to download this program and I'm not sure how to do it. Can you > help m

Re: [R] Grouping data in a data frame: is there an efficient way to do it?

2009-09-02 Thread milton ruser
Hi there, I think the option of 30 seconds is ok because it is less than each one expent reading the messages :-) Just kiding... bests milton On Wed, Sep 2, 2009 at 8:01 PM, Leo Alekseyev wrote: > Thanks everyone for the useful suggestions. The bottleneck might be > memory limitations of my

Re: [R] How to do rotation for polygon?

2009-09-02 Thread milton ruser
Hi there, require(maptools) ?elide good luck milton On Thu, Sep 3, 2009 at 1:04 AM, Hemavathi Ramulu wrote: > Hi everyone, > I have coding for repeating pentagon as below: > > plot(0:11,type="n") > for (i in 1:10 )polygon(rep(c(4,5,7,8,6)), i*c(.5,.3,.3,.5,.7), bor=2) > > which are increasing ve

Re: [R] to istall packages such as 'stats'

2009-09-03 Thread milton ruser
Hi Ajay, To install new packages try: install.packages("package_name", dependencies=T) But stats is part of base R. :-) bests miltinho On Thu, Sep 3, 2009 at 6:01 AM, Ajay Singh wrote: > Dear All, > I have to install 'stats' package in my windows machine, could you let me > know how to insta

Re: [R] variable selection in logistic

2009-09-03 Thread milton ruser
Hi Annie, What kind of data (response and explanatory) you have? As a ecological modeller, I always think first what is my (our) mind models. After that I analyze a set of concorrent - *but with ecological meaning* - models. It helps me to test hypothesis as well as to discuss the results. If you

Re: [R] Easy way to get top 2 items from vector

2009-09-03 Thread milton ruser
Hi Noah, Next time try, please, send a short reproducible code/example. May be this can be (not so elegant but) helpfull myDF<-data.frame(cbind(a=runif(5),b=runif(5))) myDF N=2 a.order<-rev(order(myDF$a))[1:N] b.order<-rev(order(myDF$b))[1:N] myDF.max2a<-myDF[a.order,] myDF.max2a myDF.max2b<-m

Re: [R] (no subject)

2009-09-06 Thread milton ruser
Hi Roslina, x<-runif(1000,min=0, max=600) hist(x) x2<-ifelse(x<=300,x,300) summary(x2) hist(x2, ,breaks = c(0,50,100,150,200,250,300)) good luck milton On Mon, Sep 7, 2009 at 12:51 AM, Roslina Zakaria wrote: > Hi r-users, > > I would like to know how to put all the data that is greater than

Re: [R] (no subject)

2009-09-06 Thread milton ruser
May be you also want: x<-runif(1000,min=0, max=600) x3<-x[x<=300] summary(x3) hist(x3, ,breaks = c(0,50,100,150,200,250,300)) bests milton On Mon, Sep 7, 2009 at 1:01 AM, milton ruser wrote: > Hi Roslina, > > x<-runif(1000,min=0, max=600) > hist(x) > > x2&l

Re: [R] fitting nonlinear model

2009-09-09 Thread milton ruser
Hi Bill, I am not sure what you want, but... mydf<-read.table(stdin(), head=T, sep=",") Np,year 96,2 91,5 89,7 85,10 plot(Np~year, data=mydf) mymodel<-lm(Np~year, data=mydf) abline(mymodel, col="red") bests milton On Wed, Sep 9, 2009 at 2:27 PM, Bill Hyman wrote: > My data look like: > > Np

Re: [R] fitting nonlinear model

2009-09-09 Thread milton ruser
, data=mydf.new, lty=2) cheers milton On Wed, Sep 9, 2009 at 3:01 PM, milton ruser wrote: > Hi Bill, > > I am not sure what you want, but... > > mydf<-read.table(stdin(), head=T, sep=",") > Np,year > 96,2 > 91,5 > 89,7 > 85,10 > > plot(Np~year,

Re: [R] Joining Characters in R {issue with paste}

2009-09-09 Thread milton ruser
You not tryed ?paste :-) paste(a,b,sep="") bests milton On Wed, Sep 9, 2009 at 5:08 PM, Abhishek Pratap wrote: > Hi Guys > I am want to join to strings in R. I am using paste but not getting > desirable result. > > For the sake of clarity, a quick example: > > > a="Bio" > > b="iology" > > pas

Re: [R] (no subject)

2009-09-13 Thread milton ruser
Hi Karen, As you are just starting (I guess), I suggest you take a shortcut: 1. copy and paste the data from Excel to the notepad, and save it as .TXT 2. If all is ok, you will have a tab-delimited file. 3. Be sure that your variables have its names on first line 4. read your data using setwd("c:

Re: [R] plotting least-squares regression against x-axis

2009-09-19 Thread milton ruser
By the way, how about: plot(y,mylm$residuals) So you can have an idea of your error distribution across your response variable domain. :-) milton toronto=brazil On Sat, Sep 19, 2009 at 9:02 PM, Sunil Suchindran wrote: > x <- seq(50) > > y <- 10 + x * 2 + rnorm(50,0,10) > > plot(y~x) > > mylm =

Re: [R] Create directory and copy files in R

2009-09-22 Thread milton ruser
Tammy Try avoid directories with spaces... may be this solve your problem. Case not, write us again. bests milton On Mon, Sep 21, 2009 at 10:05 AM, Tammy Ma wrote: > > > HI, All R users, > > My problem is: > > > fn > [1] "C:/Documents and > Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneu

Re: [R] Superimposing (aligning) two graphs

2009-09-22 Thread milton ruser
Hi Maggie: 1) plot() combined with lines() may do the job. 2) google "R graph gallery" bests milton On Tue, Sep 22, 2009 at 5:23 PM, Maggie wrote: > Hello, I need to superimpose two graphs (plotted representations of > waver files) so I can see how much they align. Is there a quick and > di

Re: [R] Correlate two time series

2009-09-22 Thread milton ruser
Have you looked at ts() ? On Tue, Sep 22, 2009 at 5:49 PM, Maggie wrote: > I was wondering how to correlate two time series in R? I have to > plotted waver files I need to correlate to one another to see how well > they align.. > > Any guidance would be very much appreciated! > > ___

Re: [R] Separating columns, and sorting by rows

2010-02-14 Thread milton ruser
Hi Raging Jim may be this is a starting point. myDF<-read.table(stdin(),head=T,sep=",") mm,Rainfall 1977-02,17.4 1977-03,34.0 1977-04,26.2 1977-05,42.6 1977-06,58.6 1977-07,23.2 1977-08,26.8 1977-09,48.4 1977-10,47.0 1977-11,37.2 1977-12,15.0 1978-01,2.6 1978-02,6.8 1978-03,9.0 1978-04,46.6

[R] parsing strings between [ ] in columns

2010-02-18 Thread milton ruser
Dear all, I have a data.frame with a column like the x shown below myDF<-data.frame(cbind(x=c("[[1, 0, 0], [0, 1]]", "[[1, 1, 0], [0, 1]]","[[1, 0, 0], [1, 1]]", "[[0, 0, 1], [0, 1]]"))) > myDF x 1 [[1, 0, 0], [0, 1]] 2 [[1, 1, 0], [0, 1]] 3 [[1, 0, 0], [1, 1]] 4 [[0, 0,

Re: [R] how to convert character variables into numeric variables directly

2010-03-08 Thread milton ruser
Try: as.numeric(as.character( typec)) milton On Mon, Mar 8, 2010 at 12:55 PM, Xumin Zeng wrote: > Here is the example. > > > age=18:29 > > height=c(76.1,77,78.1,78.2,78.8,79.7,79.9,81.1,81.2,81.8,82.8,83.5) > > type=c("A", "B", "C", "D","A", "B", "C", "D","A", "B", "C", "D") > > typec=c("0","4",

Re: [R] modify the levels of a variable

2010-03-10 Thread milton ruser
Try data2$X<-factor(data2$X) By the way, avoid call data as "data", matrix as "matrix", vector as "vector". cheers milton On Wed, Mar 10, 2010 at 4:35 PM, clee wrote: > > If anyone can help with this, I would greatly appreciate it. > > When I subset a dataframe, and then create a table of on

Re: [R] barplot with a probability density curve

2010-03-14 Thread milton ruser
Hi Olga, may be you can work around with the suggestions below, while other provide the best solution for your: barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"), xlab="diameter",ylab="flow",main="some title",space=0.1) lines(lowess(c(1,2,3,5,2,3,1),f=1), type="b",

Re: [R] labels gone

2010-03-15 Thread milton ruser
Hi Zhongyi, I must confess I not understood completely what you need, but... Tau<-seq(0.05,0.95,0.05); Pi <- seq(0.19,0.01,-0.01); par(cex.axis=0.8,ps=9,mar=c(1.5,1,0.5,1), oma=c(1,1,0.2,1) ,tck=-0.01); plot(Tau,Pi, type='l', xlab="Tau",ylab="Pi",col=4, xaxt="n", yaxt="n"); axis(1,labels=F) axis(

Re: [R] (performance) time in Windows vs Linux

2009-06-26 Thread milton ruser
Hi there, I have both systems on a DELL 64bit machine. I compiled R 2.9.0 on both systems, to get 64bits capability. Surpriselly, on Linux (Ubuntu with I installed 3 month ago) I spent 41s to run the same test you did, and less time (35s) under Vista. In fact I had noticed that I not have gained t

Re: [R] applying a function to a pair of components for each row of a list

2009-06-27 Thread milton ruser
Hi Kavitha, I must confess you that I not understood well what you are looking for. But.. mylist<-list(x=1:25, y=runif(n=25)) plot(mylist, type="n") points(mylist, type="p", col=mylist$x) Hth, miltinho On Sun, Jun 28, 2009 at 1:03 AM, Kavitha Venkatesan < kavitha.venkate...@gmail.com> wrote:

Re: [R] (performance) time in Windows vs Linux

2009-06-28 Thread milton ruser
Really? In fact I have a quadcore. But how can I know if Linux are really using only one core, and how can I setup it to use the 4cores? Thanks a lot, milton On Mon, Jun 29, 2009 at 1:46 AM, Patrick Connolly < p_conno...@slingshot.co.nz> wrote: > On Fri, 26-Jun-2009 at 04:37PM -040

Re: [R] How to use "subset" in lm function

2009-06-29 Thread milton ruser
Like this? x<-1:100 y<-runif(100) df<-data.frame(cbind(x,y)) mycoef.list<-NULL for (i in 10:65) { mycoef<-coef(lm(y~x, data=subset(df, x %in% 1:i)))[2] mycoef.list <-c(mycoef.list, mycoef) } hist(mycoef.list) regards milton brazil=toronto On Mon, Jun 29, 2009 at 2:50 PM, Hongwei Dong wrot

Re: [R] How do I change which R Graphics Device is active?

2009-06-30 Thread milton ruser
How about: dev.cur() dev.list() dev.next(which = dev.cur()) dev.prev(which = dev.cur()) dev.off(which = dev.cur()) dev.set(which = dev.next()) dev.new(...) graphics.off() dev.cur() dev.list() dev.next(which = dev.cur()) dev.prev(which = dev.cur()) dev.off(which = dev.cur()) dev.set(which = dev.nex

Re: [R] (no subject)

2009-07-02 Thread milton ruser
Hi Andriy Fetsun, How about include a "subject title" on the subject of the email like "length funcion not work". By the say, send us the result of str(your_object). Bests milton brazil=toronto On Thu, Jul 2, 2009 at 9:01 AM, Andriy Fetsun wrote: > Hi Guys, > > It is very simple question, but

Re: [R] output too large to display all

2009-07-06 Thread milton ruser
Hi Christine, How about try again? Cheers milton On Mon, Jul 6, 2009 at 11:34 AM, Christine Griffiths < christine.griffi...@bristol.ac.uk> wrote: > Hi R Users, > > Hopefully a very simple solution, but I am stumped nevertheless. I am > running glmer in which the output is too large so that n

Re: [R] How to separate the string?

2009-07-07 Thread milton ruser
hi hema may be strsplit can help on the job. bests. milton On Tue, Jul 7, 2009 at 3:54 AM, Hemavathi Ramulu wrote: > Hi everyone, > Hi want to separate the string(column1) for example > > column1 column2 column3 column4 column5 column6 > bear b e a r >

Re: [R] how to transpose a dataframe

2009-07-09 Thread milton ruser
Hi there, ?reshape do the job. bests milton On Thu, Jul 9, 2009 at 9:31 PM, roachyang wrote: > > I want to transpose a dataframe like > level 2006 2007 2008 >A >B . >C > into > levelyear >A 2006 >

Re: [R] how to transpose a dataframe

2009-07-09 Thread milton ruser
Hi roachyang, you need to be more precise on your email. But believe that you tryed one of the funtions like reshape or transform and the output has been printed on your R session. If your dataset are large, is better you assign your output on a object - like myobj<-reshape(...) - and then save yo

Re: [R] drawing hmms

2009-07-10 Thread milton ruser
Hi Rajesh, As you was little clean on your asking, try give a look at one of those pages. http://finzi.psych.upenn.edu/R/library/msm/html/msm.html http://finzi.psych.upenn.edu/R/library/msm/html/hmm-dists.html http://finzi.psych.upenn.edu/R/library/mhsmm/html/hsmmspec.html http://finzi.psych.upen

Re: [R] drawing hmms

2009-07-10 Thread milton ruser
n Fri, Jul 10, 2009 at 4:04 AM, rajesh j wrote: > Hi, > > I actually dont need something thats about hmm's.Something like the plotmat > in diagram package would suffice.But I need to be able to include plots > beside the graph nodes. > > > On Fri, Jul 10, 2009 at 12:

Re: [R] sort data.frame by specific date column

2009-07-10 Thread milton ruser
Hi Mark, Like this? mydf<-read.table(stdin(), head=T) Trade PosType EnDate EnTime ExDate ExTime PL_Pos 1 1 1040107915 1040107 1300164 2 1 1040108909 1040108 1300184 3 1 1040115921 1040115 1300 64 4 1 1040120 1134 1040120 1300124 5

Re: [R] maximum/minimum value of a function

2009-07-10 Thread milton ruser
Hi Derek, like this? myfunction<-function(xmin, xmax, number_of_values) { xvalues<-seq(from=xmin, to=xmax, by = ((xmax - xmin)/(number_of_values - 1))) outputvalues<-xvalues^2+(xmax/xvalues)^3*runif(number_of_values) return(outputvalues) } my.values<-myfunction(1,10,100) min(my.values) max(m

Re: [R] mann-whitney U-test - U-value

2009-07-11 Thread milton ruser
Martin, If I am not wrong the difference is that if you has two levels you get U-test, and W-test for more than two levels. But the test is almost the same. cheers milton On Sat, Jul 11, 2009 at 2:13 PM, Martin Batholdy wrote: > Hi, > > I know that I can perform a Mann-Whitney U test with wi

Re: [R] Reading data entered within an R program

2009-07-11 Thread milton ruser
*hum* I prefer stdin() because you not need to explain to your student or beginners about TextConnection. cheers milton On Sat, Jul 11, 2009 at 4:38 PM, Muenchen, Robert A (Bob) wrote: > Dear R-helpers, > > I know of two ways to reading data within an R program, using > textConnection and stdi

Re: [R] plm Issues

2009-07-11 Thread milton ruser
The first think one need to do when has a so old version, is update it :-) After, if the problem remain, try get help with the colleagues. best milton On Thu, Jul 9, 2009 at 10:58 AM, Damien Moore wrote: > Hi List > > I'm having difficulty understanding how plm should work with dynamic > formul

[R] Renviron.in error when compiling R 2.9.1 under Debian.

2009-07-16 Thread milton ruser
Dear all, I'm trying to compile R 2.9.1 on my home directory under debian, and as I need to play with RPy, I tryed compile R using: ./configure --enable-R-shlib But, during the compilation, I get the error below: - using as R_SHELL for scripts ... /bin/sh conf

Re: [R] Renviron.in error when compiling R 2.9.1 under Debian.

2009-07-16 Thread milton ruser
Dear R-friends, I removed the directory, untarzed the source files and now I can compile the R. Thanks for those suggested it off-list. Bests milton On Thu, Jul 16, 2009 at 6:08 PM, milton ruser wrote: > Dear all, > > I'm trying to compile R 2.9.1 on my home directory under de

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-16 Thread milton ruser
*hum* How much of the "employes" of your institute use statistical softwares? 1-5? 5-20? 20-50? I think a brief description could help on the discussion. cheers milton On Thu, Jul 16, 2009 at 5:40 PM, Kel Lam wrote: > My institute has been heavily dependent on SAS for the past while, and > S

Re: [R] get a vector with filenames with a certain extension in a folder

2009-07-16 Thread milton ruser
Hi there, try this: setwd("/home/mcr") dir(path=".", pattern=".txt$") OR dir(path="/home/mcr/.", pattern=".txt$") $ means finished with ".txt" good luck, milton brazil=toronto On Fri, Jul 17, 2009 at 12:08 AM, torpedo fisken wrote: > Hi > I got a script that works on file with the extensio

Re: [R] Normalize data

2009-07-20 Thread milton ruser
require(vegan) library(help=vegan) :-) On Mon, Jul 20, 2009 at 2:03 PM, Noah Silverman wrote: > Hello, > > I'm coming from RapidMiner, so some of the "easy" things there are a bit > difficult for me to find in R > > How do I normalize data in a data frame. Ideally I want to scale the > values f

Re: [R] How to extract the upper xlim and ylim of my plot?

2009-07-21 Thread milton ruser
May be: text(.1*max(all$AREA),.9*max(all$SR),"text to be placed") ? bests milton On Tue, Jul 21, 2009 at 5:03 PM, Mark Na wrote: > Dear R-helpers, > > I wish to place some text in a plot, at approx 10% of my upper xlim and > approx 90% of my upper ylim, i.e. > > > plot(log(all$SR,10)~log(all

Re: [R] Calculate weighted mean for each group

2009-07-23 Thread milton ruser
try your first "reproducible line" first :-) On Thu, Jul 23, 2009 at 5:18 PM, Alexis Maluendas wrote: > Hi R experts, > > I need know how calculate a weighted mean by group in a data frame. I have > tried with aggragate() function: > > data.frame(x=c(15,12,3,10,10),g=c(1,1,1,2,2,3,3),w=c(2,3,1,

  1   2   3   >