Hi,

I tried that too. It still gives me the same error.

Regards,

Uma  

 

 

 


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Erich
Neuwirth
Sent: Tuesday, January 22, 2008 7:05 AM
To: R (D)COM and RExcel server related issues
Subject: Re: [Rcom-l] Read Excel data



Uma Sitaraman wrote:
> Hi,
> 
>  
> 
> I am new to both R and RDcom, and am stuck trying to read excel data
> using R (through VBA code). I tried out the test code posted in the
web
> (given below)
> 
>  
> 
>  Sub ReadTest()
> 
>>     rinterface.StartRServer
> 
>>     rinterface.RRun "setwd(""c:/work/rcomtest"")"
> 
>>     ChDir "c:\work\rcomtest"
> 
>>     rinterface.RunRFile "read.R"
> 
>>     rinterface.StopRServer
> 
>>     *rinterface.getdataframe "mydat", Range("Sheet1!A1")*
> 
>> End Sub


you only can stop the server AFTER you have transferred the data to
excel.



> 
>> 
> 
>> 
> 
>> --- read.R
> 
>> 
> 
>> setwd("c:/work/rcomtest")
> 
>> mydat<-read.csv("data.txt")
> 
>> 
> 
>> 
> 
>> --- data.txt
> 
>> 
> 
>> xxx1,zzz2
> 
>> 1,2
> 
>> 3,4
> 
>> 5,6
> 
>  
> 
> It gives me an error "Run-time error 13- Type mismatch" and when I try
to debug, it stops at line below in the RInterface Module. 
> 
>  
> 
> nrows = REvalReturn("dim(" & DFname & ")[1]") + 1.
> 
>  
> 
> I am using R (2.5.1) and RSrv200.exe.
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> Regards,
> 
>  
> 
>  
> 
>  
> 
> -Uma    
> 
>  
> 
> This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this
> e-mail in error) please notify the sender immediately and destroy this
e-mail. Any unauthorized copying, disclosure or distribution of
> the material in this e-mail is strictly forbidden.  Any views or
opinions presented are solely those of the author and do not
> necessarily represent those of Amba Holdings Inc., and/or its
affiliates.  Important additional terms relating to this email can be
obtained
> at  http://www.ambaresearch.com/disclaimer
> 
> 
>
------------------------------------------------------------------------
> 
> _______________________________________________
> Rcom-l mailing list
> Rcom-l@mailman.csd.univie.ac.at
> http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
> More information (including a Wiki) at http://rcom.univie.ac.at

-- 
Erich Neuwirth, University of Vienna
Faculty of Computer Science
Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-39464 Fax: +43-1-4277-39459

_______________________________________________
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this
e-mail in error) please notify the sender immediately and destroy this e-mail. 
Any unauthorized copying, disclosure or distribution of
the material in this e-mail is strictly forbidden.  Any views or opinions 
presented are solely those of the author and do not
necessarily represent those of Amba Holdings Inc., and/or its affiliates.  
Important additional terms relating to this email can be obtained
at  http://www.ambaresearch.com/disclaimer

_______________________________________________
Rcom-l mailing list
Rcom-l@mailman.csd.univie.ac.at
http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l
More information (including a Wiki) at http://rcom.univie.ac.at

Reply via email to