poorman, a base R implementation of dplyr

13 views
Skip to first unread message

Per Nyfelt

unread,
Apr 6, 2020, 7:16:30 AM4/6/20
to Renjin
Hi,


It is an implementation of the dplyr functions in base R. As DESCRIPTION claims R (>= 3.4), it should be possible to run it in Renjin. 

A Renjin version is not yet available in the bedatadriven nexus so I was curious to build it myself to try it out. 

It is fairly simple to put together a pom file based on the DESCRIPTION file and build a jar but this could be completely automated. I guess there must be something like this already that automatically converts CRAN packages to Renjin packages. I imagine there could be a CRAN package that allows you to (in GNU-R) create a pom or gradle build file based on the DESCRIPTION and some probing of directories to easily allow one to create a Renjin version of the GNU-R package. What do you think? Would it be possible to reuse some or all of the automated Renjin-cran stuff for what I have in mind? 

After building a jar and trying it out I find that some things works and others do not. For the curious:
library("com.github.nathaneastwood:poorman")
# Not working: (EvalException: undefined columns selected)
print(mtcars %>% select(mpg, gear, disp))


# Not working: (EvalException: invalid subscript type 'pairlist')
print(mtcars %>% filter(mpg > 28))


# Can run but no mpg2 column
print(mtcars %>% mutate(mpg2 = mpg ^ 2))


# WORKS
print(mtcars %>% arrange(mpg))


# Not working: (EvalException: Invalid groups: pairlist(am, cyl))
print(
mtcars
%>%
  group_by
(am, cyl) %>%
  summarise
(meanMpg = mean(mpg), sumMpg = sum(mpg)) %>%
  ungroup
()
)  

Best regards,
Per
Reply all
Reply to author
Forward
0 new messages