{"action":"created","issue":{"url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/20","repository_url":"https://api.github.com/repos/Bioconductor/S4Vectors","labels_url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/20/comments","events_url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/20/events","html_url":"https://github.com/Bioconductor/S4Vectors/issues/20","id":335931392,"node_id":"MDU6SXNzdWUzMzU5MzEzOTI=","number":20,"title":"model.frame method","user":{"login":"LiNk-NY","id":4392950,"node_id":"MDQ6VXNlcjQzOTI5NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/4392950?v=4","gravatar_id":"","url":"https://api.github.com/users/LiNk-NY","html_url":"https://github.com/LiNk-NY","followers_url":"https://api.github.com/users/LiNk-NY/followers","following_url":"https://api.github.com/users/LiNk-NY/following{/other_user}","gists_url":"https://api.github.com/users/LiNk-NY/gists{/gist_id}","starred_url":"https://api.github.com/users/LiNk-NY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiNk-NY/subscriptions","organizations_url":"https://api.github.com/users/LiNk-NY/orgs","repos_url":"https://api.github.com/users/LiNk-NY/repos","events_url":"https://api.github.com/users/LiNk-NY/events{/privacy}","received_events_url":"https://api.github.com/users/LiNk-NY/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-26T18:00:46Z","updated_at":"2018-08-10T15:15:26Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It seems like when using `lm`-type of functions, the `DataFrame` does not behave like the\r\n`data.frame`. \r\nAn example as given in therneau/survival#46: \r\n\r\n```\r\nlibrary(splines)\r\nlibrary(S4Vectors)\r\ndata(longley)\r\ntest <- DataFrame(longley)\r\ntest$year2 <- ns(test$Year, 3)\r\n\r\nmodel.frame(GNP ~ Unemployed + year2, data = test)\r\n## Error: object 'year2' not found\r\n\r\n# similarly...\r\n\r\n\r\nlm(GNP ~ Unemployed + year2, test)\r\n## Error: object 'year2' not found\r\n```\r\n\r\nRegards,\r\nMarcel"},"comment":{"url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/comments/412113867","html_url":"https://github.com/Bioconductor/S4Vectors/issues/20#issuecomment-412113867","issue_url":"https://api.github.com/repos/Bioconductor/S4Vectors/issues/20","id":412113867,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjExMzg2Nw==","user":{"login":"LiNk-NY","id":4392950,"node_id":"MDQ6VXNlcjQzOTI5NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/4392950?v=4","gravatar_id":"","url":"https://api.github.com/users/LiNk-NY","html_url":"https://github.com/LiNk-NY","followers_url":"https://api.github.com/users/LiNk-NY/followers","following_url":"https://api.github.com/users/LiNk-NY/following{/other_user}","gists_url":"https://api.github.com/users/LiNk-NY/gists{/gist_id}","starred_url":"https://api.github.com/users/LiNk-NY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiNk-NY/subscriptions","organizations_url":"https://api.github.com/users/LiNk-NY/orgs","repos_url":"https://api.github.com/users/LiNk-NY/repos","events_url":"https://api.github.com/users/LiNk-NY/events{/privacy}","received_events_url":"https://api.github.com/users/LiNk-NY/received_events","type":"User","site_admin":false},"created_at":"2018-08-10T15:15:26Z","updated_at":"2018-08-10T15:15:26Z","author_association":"CONTRIBUTOR","body":"Hi Michael, @lawremi \r\n\r\nThe `model.frame` method could look like this: \r\n\r\n```r\r\nmodel.frame.DataFrame <- function(formula, ...)\r\n{\r\n    formula <- as.data.frame(formula)\r\n    NextMethod()\r\n}\r\n```\r\n\r\nIt uses the `model.frame.default` method on a `data.frame`.\r\n\r\n`model.frame` dispatches on the `formula` class. I'm not sure how to make it work with `DataFrame`\r\nother than modifying `model.frame.default`. Coercing to environment beforehand when\r\n`model.frame.default` works though:\r\n\r\n```r\r\nmodel.frame(GNP ~ Unemployed + year2, data = as.env(test))\r\n```"}}
{"actor":{"display_login":"LiNk-NY"}}