On Fri, Feb 15, 2008 at 3:40 AM, Vince Fulco <[EMAIL PROTECTED]> wrote:
> Dear RPY experts-
>
>  I am still getting up to speed on the different conversion
>  features...Is there any obvious reason why this code is adding a space
>  when 'paste' is used?
>
>  rpy.set_default_mode(rpy.BASIC_CONVERSION)
>
>  I am attempting to combine the directory and a file into one variable
>  and then assigning it to another (latter not shown)
>
>  rpy.r("dir1<- '/home/foouser/foo/'")

Have you looked at rpy.assign(...) command?  e.g.

rpy.assign("dir1", "/home/foouser/foo/")

>  rpy.r("dat.file<- paste(dir1, 'prices.txt', sep="")")
>
>  '/home/foouser/foo/ prices.txt'

Very odd.

Out of interest, why are you doing string concatenation in R using
paste, when you can do it directly in python with plus?  Something
like this perhaps, using python's os module to mess about with the
paths...

import os
rpy.assign("dat.file", os.path.join(rpy.r("dir1"), "prices.txt"))

[The above would be simpler if dir1 was available as a python variable]

>  Of course this works in R directly and a search of RPY info sources
>  for paste func() with sep doesn't turn up anything useful.

It certainly looks like there is a bug here somewhere...

Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to