{"action":"opened","issue":{"url":"https://api.github.com/repos/jeroenooms/jsonlite/issues/116","labels_url":"https://api.github.com/repos/jeroenooms/jsonlite/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/jeroenooms/jsonlite/issues/116/comments","events_url":"https://api.github.com/repos/jeroenooms/jsonlite/issues/116/events","html_url":"https://github.com/jeroenooms/jsonlite/issues/116","id":116126327,"number":116,"title":"`stream_in` doesn't process jsonlines examples","user":{"login":"sebastian-c","id":1818581,"avatar_url":"https://avatars.githubusercontent.com/u/1818581?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastian-c","html_url":"https://github.com/sebastian-c","followers_url":"https://api.github.com/users/sebastian-c/followers","following_url":"https://api.github.com/users/sebastian-c/following{/other_user}","gists_url":"https://api.github.com/users/sebastian-c/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastian-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastian-c/subscriptions","organizations_url":"https://api.github.com/users/sebastian-c/orgs","repos_url":"https://api.github.com/users/sebastian-c/repos","events_url":"https://api.github.com/users/sebastian-c/events{/privacy}","received_events_url":"https://api.github.com/users/sebastian-c/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-10T15:14:04Z","updated_at":"2015-11-10T15:14:04Z","closed_at":null,"body":"On the [jsonlines website](http://jsonlines.org/examples/), the following example is given (represented in R):\r\n\r\n```\r\njson <- \"[\\\"Name\\\", \\\"Session\\\", \\\"Score\\\", \\\"Completed\\\"]\r\n[\\\"Gilbert\\\", \\\"2013\\\", 24, true]\r\n[\\\"Alexa\\\", \\\"2013\\\", 29, true]\r\n[\\\"May\\\", \\\"2012B\\\", 14, false]\r\n[\\\"Deloise\\\", \\\"2012A\\\", 19, true]\"\r\n```\r\n\r\nThe best way to stream this data in would be:\r\n```\r\nxx <- textConnection(json, open=\"r\")\r\nheaders <- jsonlite::fromJSON(readLines(xx,1))\r\ndata <- jsonlite::stream_in(xx)\r\nclose(xx)\r\nnames(data) <- headers\r\n```\r\nHowever, if one looks at the structure of the data:\r\n\r\n```\r\n> str(data)\r\n'data.frame':\t4 obs. of  4 variables:\r\n $ Name     : Factor w/ 4 levels \"Alexa\",\"Deloise\",..: 3 1 4 2\r\n $ Session  : Factor w/ 3 levels \"2012A\",\"2012B\",..: 3 3 2 1\r\n $ Score    : Factor w/ 4 levels \"14\",\"19\",\"24\",..: 3 4 1 2\r\n $ Completed: Factor w/ 2 levels \"FALSE\",\"TRUE\": 2 2 1 2\r\n```\r\n\r\nGiven that this is one of the examples given by the jsonlines site, it should be parsed into a `data.frame` with the correct types, shouldn't it?"}}