Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This may not completely answer your question, but note that dot methods in R become underscores in Sage.

sage: r.read[tab]
r.read              r.read_csv          r.read_ftable
r.readBin           r.read_csv2         r.read_fwf
r.readChar          r.read_dcf          r.read_socket
r.readCitationFile  r.read_delim        r.read_table
r.readLines         r.read_delim2       r.read_table_url
r.read_DIF          r.read_fortran      r.readline
sage: r.read_table?
<snip>
Definition:     r.read_table(self, *args, **kwds)
Docstring:
    read.table                package:utils                R Documentation

    Data Input

    Description:

         Reads a file in table format and creates a data frame from it,
         with cases corresponding to lines and variables to fields in the
         file.

    Usage:

         read.table(file, header = FALSE, sep = "", quote = "\"'",
                    dec = ".", row.names, col.names,
                    as.is = !stringsAsFactors,
                    na.strings = "NA", colClasses = NA, nrows = -1,

I don't have your bar.txt, though, and unfortunately passing optional arguments can be tricky, sometimes calling for multiple levels of quotes, sometimes not. I've often used r.eval("R command") for that, like

r.eval('zsummin(loca.p(c(%s),c(%s),c(%s)),max.iter=400,algorithm="\%s")'%(str(exes)[1:-1],str(whys)[1:-1],str(prof)[1:-1],algorithm))

which however is not ideal, but it gets the job done.