0

I have a column (called remarks) in a data frame containing data of this format. Each row has data that is of this format.

[{"Market": "test1", "Status": "FILLED", "Account": "", "Comment": "", "FilledPrice": 8026.7}]

Is there a way for me to extract out the values by calling the key. say I want the value of "Market" and it gives me "test1" etc.

Humpelstielzchen
  • 6,126
  • 3
  • 14
  • 34
user7729135
  • 399
  • 1
  • 3
  • 11

1 Answers1

1

You can use library(jqr) to manipulate and access JSON strings

library(jqr)

js <- '[{"Market": "test1", "Status": "FILLED", "Account": "", "Comment": "", "FilledPrice": 8026.7}]'

jqr::jq(js, ".[].Market")
# "test1"
SymbolixAU
  • 25,502
  • 4
  • 67
  • 139