0

There is a Python-focused question on this here but I want to do the same totally in R. I want to execute the edits in the OpenRefine JSON on CSV in R.

I have tried a solution in jsonlite but not yet satisfied, very messy to parse the JSON edits and apply them on any CSV. Perhaps, there are some JSON parsers to make the process easier. The OpenRefine JSON contains many different edits and potentially even GREPL and Jython/Python code to make this process a bit harder. So perhaps someone has considered a ready solution for this.

How to clean up messy CSV according to OpenRefine JSON in R?

Helper questions

  1. Does there exist some packages just for this like finding all values of from fields even in sublists of the JSON?

  2. Does there exist some ready package to do this?

  3. There are fields such as to, from and for all different kind of edit, you have a new edit operations. Which R packages are ideal for this?

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282
  • 1
    Maybe just use the [CRAN package rrefine](https://cran.r-project.org/package=rrefine) for R access to Open Refine? – Dirk Eddelbuettel Jul 31 '17 at 21:38
  • 1
    I am interested. I often start a project in OpenRefine and then reproduce it in R or Python/Pandas using a series of custom functions. An automatic translator would be really useful. But it's not a trivial problem. – Ettore Rizza Jul 31 '17 at 21:48
  • @DirkEddelbuettel rrefine package assumes that the OpenRefine server is on while this question does not assume it. – hhh Jul 31 '17 at 22:31
  • 1
    @Ettore Rizza https://github.com/OpenRefine/OpenRefine/issues/1220 if OpenRefine is done modularly, we should find a ready Java function that we may be able to utilise from its repo. – hhh Aug 01 '17 at 10:40
  • @hhh Of course. All the java functions are stored [here](https://github.com/OpenRefine/OpenRefine/tree/master/main/src/com/google/refine) – Ettore Rizza Aug 01 '17 at 11:00
  • @Ettero Rizza https://github.com/vpnagraj/rrefine/issues/4 request on this related to rrefine package. – hhh Aug 01 '17 at 14:51

0 Answers0