Re: [Rcom-l] Excel Macro

2007-08-15 Thread Felipe Carrillo
lways worked as long > as I > > am running my script through Tinn-R or directly in > the > > R Console. If read.table doesn't work with a macro > > then I will probably stick with Tinn-R directly. > > > > --- "Lindsay, Dwayne" <[EMAIL PROTECTED

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Erich Neuwirth
ssage- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On >> Behalf Of Erich >> Neuwirth >> Sent: Tuesday, August 14, 2007 1:02 PM >> To: R (D)COM and RExcel server related issues >> Subject: Re: [Rcom-l] Excel Macro >> >> sh

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Felipe Carrillo
: Tuesday, August 14, 2007 1:02 PM > To: R (D)COM and RExcel server related issues > Subject: Re: [Rcom-l] Excel Macro > > show us your read.table command. > does it have the fiull path with the right kind of > backlslahes > or slashes? > > Felipe Carrillo wrote:

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Felipe Carrillo
Not sure what am I doing wrong...I copied my Test.r file into the spreadsheet on cells A1:A3 then I selected A1 and clicked on RExcel|Run Code,then selected A2 then A3 and did the same thing.By doing it this way it works fine but I can't get it to work through the macro. I also tried Dwayne's tip b

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Lindsay, Dwayne
Read.table does not work when reading from Excel. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erich Neuwirth Sent: Tuesday, August 14, 2007 1:02 PM To: R (D)COM and RExcel server related issues Subject: Re: [Rcom-l] Excel Macro show us your

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Lindsay, Dwayne
Subject: Re: [Rcom-l] Excel Macro Erich: The code below has a read.table(.)statement and is ignored by R. Can you point out what am I doing wrong or if I need additional code? Thanks Sub Testing() Call RInterface.StartRServer Call RInterface.RunRFile("C:\Documents and Settings\Owner\Desk

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Lindsay, Dwayne
ECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Felipe Carrillo Sent: Tuesday, August 14, 2007 10:55 AM To: R (D)COM and RExcel server related issues Subject: RE: [Rcom-l] Excel Macro Dwayne: Thanks a lot for your help,it works fine but for some reason when I try to import a dataset within my script R do

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Erich Neuwirth
are you using th R(D)COM server or rcom. I suggest you ise rcom, then you see what is happening. you also can switch on debugging in RExcel to see what goes wrong. Felipe Carrillo wrote: > # The filename is Test.r > chinook <- read.table("C:/Documents and > Settings/Owner/Desktop/R-Software/chi

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Felipe Carrillo
# The filename is Test.r chinook <- read.table("C:/Documents and Settings/Owner/Desktop/R-Software/chinook.txt",header=T,sep="\t") chinook$IDDate <- as.Date(chinook$IDDate, "%m/%d/%Y") qplot(IDDate,Fry, data=chinook, geom="line") I try to call it like this: Sub Testing() Call RInterface.StartRSe

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Erich Neuwirth
show us your read.table command. does it have the fiull path with the right kind of backlslahes or slashes? Felipe Carrillo wrote: > Erich: > The code below has a read.table(.)statement and is > ignored by R. Can you point out what am I doing wrong > or if I need additional code? Thanks > > S

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Felipe Carrillo
Erich: The code below has a read.table(.)statement and is ignored by R. Can you point out what am I doing wrong or if I need additional code? Thanks Sub Testing() Call RInterface.StartRServer Call RInterface.RunRFile("C:\Documents and Settings\Owner\Desktop\R-Software\ATest.r") End Sub ---

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Lindsay, Dwayne
Felipe- Did you get my previous reply on importing data? D- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Felipe Carrillo Sent: Tuesday, August 14, 2007 10:55 AM To: R (D)COM and RExcel server related issues Subject: RE: [Rcom-l] Excel Macro Dwayne

Re: [Rcom-l] Excel Macro

2007-08-14 Thread Erich Neuwirth
The script can use all R functions for reading data, load (for workspaces) or read.table or read.spss (from package foreign) Felipe Carrillo wrote: > Dwayne: > Thanks a lot for your help,it works fine but for some > reason when I try to import a dataset within my script > R doesn't execute. It wo

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Felipe Carrillo
Dwayne: Thanks a lot for your help,it works fine but for some reason when I try to import a dataset within my script R doesn't execute. It works if I include something like this in my script: set.seed(101) gender <- factor(x=c(rep("Male",30),rep("Female",70))) age.class <- factor(x=rep(c("Y","

RE: [Rcom-l] Excel Macro

2007-08-14 Thread Lindsay, Dwayne
Felipe- This is a sample of code that I often use: Call RInterface.RRun(" source(""C://temp//Capital Tracking Script.txt"", local = F, chdir = T) ") Where the .txt file is my R-script saved as a .txt file. I find it a lot easier to do most of my programming in R, and use VBA only as an interface