{"action":"closed","issue":{"url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/68","labels_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/68/comments","events_url":"https://api.github.com/repos/davidgohel/ReporteRs/issues/68/events","html_url":"https://github.com/davidgohel/ReporteRs/issues/68","id":58075466,"number":68,"title":"Flextable in RStudio","user":{"login":"glennmschultz","id":5162375,"avatar_url":"https://avatars.githubusercontent.com/u/5162375?v=3","gravatar_id":"","url":"https://api.github.com/users/glennmschultz","html_url":"https://github.com/glennmschultz","followers_url":"https://api.github.com/users/glennmschultz/followers","following_url":"https://api.github.com/users/glennmschultz/following{/other_user}","gists_url":"https://api.github.com/users/glennmschultz/gists{/gist_id}","starred_url":"https://api.github.com/users/glennmschultz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glennmschultz/subscriptions","organizations_url":"https://api.github.com/users/glennmschultz/orgs","repos_url":"https://api.github.com/users/glennmschultz/repos","events_url":"https://api.github.com/users/glennmschultz/events{/privacy}","received_events_url":"https://api.github.com/users/glennmschultz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/davidgohel/ReporteRs/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-18T14:39:09Z","updated_at":"2015-02-23T16:16:46Z","closed_at":"2015-02-23T16:16:46Z","body":"Hi, I was trying to use Flextable in R Studio as part of .Rmd file and then using the option knit to Word. Flextable does not seem to work under this scheme.  Perhaps because a document needs to be specified.  Below is the markdown code that I am using in R Studio.  Maybe I am doing something wrong.  Nonetheless, really cool package.\r\n\r\nGlenn\r\n\r\ntitle: \"Short Term Prepayment Projections\"\r\noutput: word_document\r\n---\r\n\r\nFebruary Projections\r\n\r\nBelow is a graph of our Feb. 2015 short-term predictions for FNMA 30-year MBS\r\n\r\n```{r  fig.height=8 ,fig.width=7 ,echo = FALSE, message=FALSE}\r\nlibrary(ggplot2)\r\nlibrary(gridExtra)\r\nlibrary(ReporteRs)\r\nlibrary(rJava)\r\noptions( \"ReporteRs-fontsize\" = 3 )\r\n\r\nFlexTable(predicted)\r\n\r\n#grid.table(predicted[,c(2,3,5)])\r\n\r\nPlotData <- data.frame(cbind(predicted$Coupon, \r\n                predicted$PoolOrigYear, \r\n                 predicted[,12], \r\n                (predicted[,12]/predicted[,11])-1))\r\n                colnames(PlotData) = c(\"Coupon\", \"PoolOrigYear\", \"CPR\",\"PctChg\")\r\n\r\n        plot1 <- ggplot(subset(PlotData, (PoolOrigYear >= 2003 & PoolOrigYear <=2006) & Coupon <= 5.5), \r\n            aes(x = as.factor(Coupon), y = CPR, weight = PctChg, colour = PctChg))+\r\n                        geom_point(alpha = 0.8, guide = \"none\") +\r\n                        facet_grid(.~PoolOrigYear) +\r\n                         theme(axis.text.x=element_text(size = 7))\r\n\r\n       \r\n        plot2 <- ggplot(subset(PlotData, (PoolOrigYear >= 2007 & PoolOrigYear <=2010) & Coupon <= 5.5), \r\n            aes(x = as.factor(Coupon), y = CPR, weight = PctChg, colour = PctChg))+\r\n                        geom_point(alpha = 0.8, guide = \"none\") +\r\n                        facet_grid(.~PoolOrigYear) +\r\n                         theme(axis.text.x=element_text(size = 7))\r\n\r\n       plot3 <- ggplot(subset(PlotData, (PoolOrigYear >= 2011 & PoolOrigYear <=2014) & Coupon <= 5.5), \r\n            aes(x = as.factor(Coupon), y = CPR, weight = PctChg, colour = PctChg))+\r\n                        geom_point(alpha = 0.8, guide = \"none\") +\r\n                        facet_grid(.~PoolOrigYear) +\r\n                         theme(axis.text.x=element_text(size = 7))\r\n\r\n        grid.arrange(plot1, plot2, plot3, nrow = 3 )\r\n   \r\n```\r\n"}}