[datatable-help] Problem with data.table and FastRWeb
Bacou, Melanie
mel at mbacou.com
Tue Feb 18 06:31:51 CET 2014
Hi Arun,
This is a little tricky to reproduce unless you have installed FastRWeb,
and then started the FastRWeb server. I'm executing these scripts from
the browser through a call to FastRWeb running on a local port.
Installation is documented here and is quick and straightforward on Linux:
https://rforge.net/FastRWeb/
and an example here:
http://jayemerson.blogspot.mx/2011/10/setting-up-fastrwebrserve-on-ubuntu.html
I'm using FastRWeb to build a simple web service. As long as I stick to
data.frame methods, everything works fine and I get the expected plots
and HTML output in the browser. But calls to data.table methods (merge,
extract) all seem to default to data.frame, and I really don't know how
to debug that.
I am copying Simon Urbanek who's the maintainer of FastRWeb, in case
this is more of a FastRWeb issue.
Here is my session info (I am on CentOS 5 and cannot easily upgrade to R
3.0.2).
> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-redhat-linux-gnu (64-bit)
locale:
[1] C
attached base packages:
[1] stats graphics utils datasets grDevices methods base
other attached packages:
[1] ggmap_2.3 ggplot2_0.9.3.1 RColorBrewer_1.0-5
raster_2.2-12
[5] rgeos_0.3-3 rgdal_0.8-16 sp_1.0-14 data.table_1.8.10
[9] RJDBC_0.2-3 rJava_0.9-6 DBI_0.2-7 rj_1.1.2-3
loaded via a namespace (and not attached):
[1] MASS_7.3-23 RJSONIO_1.0-3 RgoogleMaps_1.2.0.5
[4] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.4
[7] grid_2.15.2 gtable_0.1.2 labeling_0.2
[10] lattice_0.20-24 mapproj_1.2-2 maps_2.3-6
[13] munsell_0.4.2 plyr_1.8 png_0.1-7
[16] proto_0.3-10 reshape2_1.2.2 rj.gd_1.1.0-1
[19] rjson_0.2.13 scales_0.2.3 stringr_0.6.2
[22] tools_2.15.2
Thanks all!
--Mel.
On 2/17/2014 6:58 AM, Arunkumar Srinivasan wrote:
> Mel,
> I'm not able to reproduce this on 1.8.11. Which version are you using?
> I'm not aware of this package, and what 'otable' is supposed to do.
> But I get no output while running your script, and not the error
> message as well.
>
>
> On Mon, Feb 17, 2014 at 11:14 AM, Bacou, Melanie <mel at mbacou.com
> <mailto:mel at mbacou.com>> wrote:
>
> Hi,
>
> I am testing an R script using FastRWeb (through Rserve). FastRWeb
> works as expected and I can successfully runs Simon Urbanek's
> examples. Problems arise when I try to merge datatables. It seems
> FastRWeb cannot find merge.data.table().
>
> I'm using plenty of other libraries (ggplot, raster, RJDBC, etc.)
> that execute successfully through FastRWeb scripts, so I'm
> guessing it's something peculiar to data.table.
>
> Thanks for any help! --Mel.
>
>
> Here are reproducible examples.
>
> Test #1: the code below (the entire content of my R script) SUCCEEDS:
>
> # test1.R
> library(data.table)
>
> run <- function(...) {
> oclear()
> d1 <- data.table(a=c(1,2,3), b=c("a","b","c"))
> d2 <- data.table(e=c("v","a","b"), f=c(4,6,7))
> otable(d1)
> otable(d2)
> }
>
> This returns a simple web page showing 2 tables:
> 1 a
> 2 b
> 3 c
>
> v 4
> a 6
> b 7
>
>
>
> Test #2: the code below (the entire content of my R script) FAILS
> with:
> Error in `[.default`(x, i) : invalid subscript type 'list'
>
> # test2.R
> library(data.table)
>
> run <- function(...) {
> oclear()
> d1 <- data.table(a=c(1,2,3), b=c("a","b","c"))
> d2 <- data.table(e=c("v","a","b"), f=c(4,6,7))
> otable(d1)
> otable(d2)
> setkey(d1, b)
> setkey(d2, e)
> otable(d1[d2])
> }
>
>
>
>
> --
> Melanie BACOU
> International Food Policy Research Institute
> Agricultural Economist, HarvestChoice
> Work+1(202)862-5699 <tel:%2B1%28202%29862-5699>
> E-mailmel at mbacou.com <mailto:mel at mbacou.com>
> Visitharvestchoice.org <http://harvestchoice.org>
>
>
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> <mailto:datatable-help at lists.r-forge.r-project.org>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
>
--
Melanie BACOU
International Food Policy Research Institute
Agricultural Economist, HarvestChoice
Work +1(202)862-5699
E-mail mel at mbacou.com
Visit harvestchoice.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20140218/6557a635/attachment-0001.html>
More information about the datatable-help
mailing list