0

I'm trying to import data in R using api link. Maybe JSON format is not valid.

Here is my API link: Link

Here is glimpse of data

{
    "Date": "2022-01-20, 6:28 pm",
    "Village Code": "324",
    "Age of Patient": "34",
    "Gender": "Male",
    "Mode of Diagnosis": "Microscopy",
    "Test Result": "Negative",
    "Type of Malaria": "Mixed (Pv+Pf)",
    "Disease Severity": "SM",
    "Treatment": "ACT + Primaquine",
    "Detection Type": "ACD"
}{
    "Date": "2022-01-26, 2:21 pm",
    "Village Code": "34",
    "Age of Patient": "22",
    "Gender": "Male",
    "Mode of Diagnosis": "RDT",
    "Test Result": "Positive",
    "Type of Malaria": "P. falciparum (Pf)",
    "Disease Severity": "SM",
    "Treatment": "Primaquine + Chloroquine",
    "Detection Type": "PCD"
}

My desired output is like that:

enter image description here

How can I import this data even if it's not valid JSON?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • Actually what you've shown is not a valid JSON format. There should be a root element and commas between objects. Did you create the API end point? – MrFlick Mar 08 '22 at 06:21
  • I did not create the API link. I had to use the link. Is there any way I can use this API link to create a data table like above screenshot? – ISMAIL AHMED Mar 08 '22 at 07:51
  • You could try adding `[` at the beginning of the file and `]` at the end and replacing every line consisting of `}{` by `},{`. – mkrieger1 Mar 08 '22 at 10:16

0 Answers0