read and write JSON-stat with R