{"action":"created","issue":{"url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/65","labels_url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/65/comments","events_url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/65/events","html_url":"https://github.com/richarddmorey/BayesFactor/issues/65","id":102633440,"number":65,"title":"A print(BFBayesFactor) function","user":{"login":"mvuorre","id":7349270,"avatar_url":"https://avatars.githubusercontent.com/u/7349270?v=3","gravatar_id":"","url":"https://api.github.com/users/mvuorre","html_url":"https://github.com/mvuorre","followers_url":"https://api.github.com/users/mvuorre/followers","following_url":"https://api.github.com/users/mvuorre/following{/other_user}","gists_url":"https://api.github.com/users/mvuorre/gists{/gist_id}","starred_url":"https://api.github.com/users/mvuorre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvuorre/subscriptions","organizations_url":"https://api.github.com/users/mvuorre/orgs","repos_url":"https://api.github.com/users/mvuorre/repos","events_url":"https://api.github.com/users/mvuorre/events{/privacy}","received_events_url":"https://api.github.com/users/mvuorre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-23T15:52:48Z","updated_at":"2015-08-23T17:57:05Z","closed_at":null,"body":"How about including a function for printing results from a Bayes Factor analysis into a data.frame? This would make it easier to knit .Rmd files with BF results in tables (.doc, LaTeX, etc.).\r\n\r\nSomething like this might suffice\r\n\r\n```\r\nprint_bf <- function(bf_obj) {\r\n    obj <- bf_obj@bayesFactor\r\n    model <- rownames(obj)\r\n    rownames(obj) <- NULL\r\n    return( as.data.frame( cbind(model, obj[,1:2]) ) )\r\n}\r\n```\r\n\r\nThanks for the great software."},"comment":{"url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/comments/133884658","html_url":"https://github.com/richarddmorey/BayesFactor/issues/65#issuecomment-133884658","issue_url":"https://api.github.com/repos/richarddmorey/BayesFactor/issues/65","id":133884658,"user":{"login":"richarddmorey","id":1284826,"avatar_url":"https://avatars.githubusercontent.com/u/1284826?v=3","gravatar_id":"","url":"https://api.github.com/users/richarddmorey","html_url":"https://github.com/richarddmorey","followers_url":"https://api.github.com/users/richarddmorey/followers","following_url":"https://api.github.com/users/richarddmorey/following{/other_user}","gists_url":"https://api.github.com/users/richarddmorey/gists{/gist_id}","starred_url":"https://api.github.com/users/richarddmorey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richarddmorey/subscriptions","organizations_url":"https://api.github.com/users/richarddmorey/orgs","repos_url":"https://api.github.com/users/richarddmorey/repos","events_url":"https://api.github.com/users/richarddmorey/events{/privacy}","received_events_url":"https://api.github.com/users/richarddmorey/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T17:57:04Z","updated_at":"2015-08-23T17:57:04Z","body":"Have you tried `as.data.frame`?\r\n\r\n    library(BayesFactor)\r\n    data(puzzles)\r\n    \r\n    bf = anovaBF(RT ~ shape*color + ID, data = puzzles, whichRandom = \"ID\")\r\n    as.data.frame(bf)[,1:2]\r\n\r\nThis will output:\r\n\r\n                                            bf       error\r\n    shape + ID                        2.802278 0.008411125\r\n    color + ID                        2.771243 0.006189023\r\n    shape + color + ID               12.583364 0.073732004\r\n    shape + color + shape:color + ID  4.038964 0.013105122\r\n\r\nThe downside is that you lose the denominator, but if you're printing you can do:\r\n\r\n    bf@denominator\r\n\r\nwhich will output:\r\n\r\n    ---\r\n     Model:\r\n    Type: BFlinearModel, JZS\r\n    RT ~ ID \r\n    Data types:\r\n    ID :  random \r\n\r\nSo you can make sure people know what the denominator is when you print it to another document.\r\n\r\nYou might also be interested in the `BayesFactorExtras` package (https://github.com/richarddmorey/BayesFactorExtras) which has a function to print interactive HTML output using `knitr`.\r\n\r\n\r\n"}}