Re: [R] Using a sting in variable names

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 13:18 -0700, olafgy wrote: > Hi there, > > I am trying to import 100 files with the names of "vpn 1 .dat" to "vpn 100 > .dat" > into a respective table calld vpn1 to vpn100. > > I therfore have created a variable X<-1:100 > > I not want to use X as a subtitute for the numb

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 17:01 -0300, Nilza BARROS wrote: > Hi, Jerome > > I was trying to use RMYSQL > > for (i in length(Query)) { > rs1<-dbSendQuery(con,Query[i]) > } > > But although the Query have several lines the command above just feed > my database with the first one. > > > Query > [

Re: [R] File to MYSQL

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 14:55 -0300, Nilza BARROS wrote: > Dear R-user, > > I have to feed my database using some SQL commands. I have already read a > data frame with the data I need but > after that these data should be write in a file wtih SQL commands. > > 1) My dataframe: > > dput(Alldados)

Re: [R] reading multiple .dbf files

2011-05-16 Thread Jerome Asselin
On Mon, 2011-05-16 at 08:40 -0700, Neera Thapa wrote: > Hello.. > I am currently working on running random forest to make predictions. For that > I > have a bunch of.dbf files from shapefiiles. Earlier I was running random > forest > on those dbf files individuallybut now I have >1,000 such fi

Re: [R] Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range

2011-05-12 Thread Jerome Asselin
On Thu, 2011-05-12 at 06:40 -0700, Mr.Q wrote: > Hello, > > How can i scale my time series in a way that 90% of the data is in the > -0.-9/ +0.9 range? > I have two methods to suggest. One that uses the ranks to scale, hence is nonparametric and will work with any data distribution. The other u

Re: [R] Regexp question

2011-05-04 Thread Jerome Asselin
On Wed, 2011-05-04 at 22:41 +0300, johannes rara wrote: > I have a string like this > > st <- "SELECT COUNT(empid), COUNT(mgrid), COUNT(empname), > COUNT(salary), FROM Employees" > > How can I remove the last comma before the FROM statement? gsub(",[^,]*FROM ", " FROM ", st) HTH, Jerome __

Re: [R] Controlling the extent of ablines on plot

2011-05-03 Thread Jerome Asselin
On Tue, 2011-05-03 at 10:36 -0600, Ryan Utz wrote: > Hi all, > > I'm attempting to make a quite-specific plot where the axes cross at the > origin and with gridlines for guidance. I've been using ablines to create > the reference lines because I want a lot of control as to where they are > placed

Re: [R] List of Data Frames

2011-05-02 Thread Jerome Asselin
On Mon, 2011-05-02 at 16:42 -0700, Mike Smith wrote: > I'm trying to create a list of Data Frames. I have 17 data frames > that I need to move through in a loop, but if I simply make a list of > them, then they do not stay data frames, and I can't sort through > them. I tried to create an array,

Re: [R] How to define specially nested functions

2011-04-28 Thread Jerome Asselin
On Thu, 2011-04-28 at 23:08 -0400, Chee Chen wrote: > Dear All, > I would like to define a function: f(x,y,z) with three arguments x,y,z, such > that: given values for x,y, f(x,y,z) is still a function of z and that I am > still allowed to find the root in terms of z when x,y are given. > For ex

Re: [R] Normality tests

2011-04-26 Thread Jerome Asselin
On Tue, 2011-04-26 at 16:15 -0400, Bruce Kindseth wrote: > I have a large amount of data which I break down into a collection of > vectors of 100-125 values each. I would like to test the normality of the > vectors and compare them. In the interactive mode I can test any one vector > using the Sh

Re: [R] separate and arrange outputs

2011-04-26 Thread Jerome Asselin
On Tue, 2011-04-26 at 19:46 +0200, ivan wrote: > Hello, > > given that a self made function produces multiple outputs, is there a > possibility to separate latter by stars or simply by blank lines? Are there > funtions for the arrangement of the output in general? You can create a class for your

Re: [R] About How to check if a html directory exists

2011-04-25 Thread Jerome Asselin
On Mon, 2011-04-25 at 12:52 -0500, Wendy Han wrote: > I want to let R automatically download available files from a website in > certain folders. Since the files I need, if exist, are in a certain > directory, I used download.file() function with a predesigned directory. > However, some of the fold

Re: [R] filling array with functions

2011-04-22 Thread Jerome Asselin
On Fri, 2011-04-22 at 10:02 -0700, derek wrote: > Hello R, > > I would like to find out how to generate array full of functions. I tried it > like this: > > fv=array(,dim=c(1,10)) > V=c(1:10) > for (i in 1:10){ > fv[i]<-function(x)(V[i]-b*a*x) # b, x are constants. > } > > But it returns: > "inc