![]() ![]() My only idea so far would be to add page breaks after every table but I have a feeling that will result in the document not flowing as smoothly as desired. I am open to any kinds of solutions whether it is something in the latex formatting that has to be changed or if it has something to do with the way the tables are put into the document. I feel like I have looked everywhere, and I can't find anyone else that has had this issue. I have included a MWE below (Sorry in advance for the length, but it is as short as it could be while still causing the problem) I have been able to debug a lot of the issues I have faced, however, there is one that still eludes me, and that is inserting tables without effecting the formatting of the surrounding text. I’m going to leave that for the next post, which I hope will be published within the next few days.I am currently working on putting together a technical report for work and I am using Rmarkdown for the first time to create this pdf. But which is better?ĭepends a lot on your margins, but instead of relying on autofit(), this seems to work well : flextable::width(., width = dim(.)$widths * 6.5 / (flextable::flextable_dim(.)$widths)) Reverting all ampersands back to and ( which mean re-running the entire pipeline from scratch) allowed me to generate the elusive final document, and a lesson learned. My first thought was I’d messed up my functions, and then I got some great advice on Twitter, and realised that the markdown file was rendering 100% completely and the failure point was between the. (Well, OK, I am, but even I have my limits).ĭebugging this took me a long time. I’m sure someone is laughing at this, thinking, “well of course you can’t have “&”, that’s a special character in html / xml”, but I didn’t know that, being as I’m not an actual super nerd. All seemed to be going well, until I tried generating a report with Skye, Lochalsh & Wester Ross as the parameter. I need to unify these, and let’s face it, typing “&” is easier, and takes up less space.īig mistake. ![]() In some datasets, this was changed to the ampersand.įor example Skye, Lochalsh and Wester Ross became Skye, Lochalsh & Wester Ross TLDR – lots of my variables had and within their names. ![]() This means, when the final documents are distributed, we will have to advise readers to accept any prompts to update external links, which always feels a bit uncomfortable. I’m not sure why I only saw this when rendering with rmarkdown::render(), but there doesn’t appear to be a way round it. If I said ‘yes’, then it would update, and appear as intended. If I said ‘no’, then the TOC did not update. But, when rendering all of the docs in a loop using purrr, there was no TOC, and instead, I was askedif I’d like to update external links within the document. When knitting docs individually, the resulting Word file opened and the table of contents was displayed. Table Of Contents not showing when docs created in loop using purrr – getting asked to update external links This returns an empty table for the edge case where currently no zones are in the specified decile. ![]() I went belt and braces here, using tibble::tribble() and tibble::add_row() if (my_nrows % However, I want the table numbers to be consistent across all the documents – table 10 in doc1 should address the same topic as table 10 in doc 2 (instead of showing table 11 data under a table10 heading). Not all areas have datazones within a certain deprivation decile, hence, there will not always be data to show. This particular table looks at deprivation. If this sounds crazy / stupid, then here’s the scenario. The Įnsuring a table returned even if no data exists Much of this is because of its infuriating layout quirks when it comes to margins,figures and tables. While I’m not adverse to Excel, I am far from a fan of Word. That’s a lot of Word, and a lot of scope for things to go wrong. This is the first phase of many similar documents.īut, I have to render my final output to Word, which, I’m not going to lie, was a bit of a worry. This will end up as 13 separate documents of about 30 pages, with lots of tables and charts. I’m currently working on a project where I am using parameterised rmarkdown for the first time – hooray! However, I urge you to put down your codpieces (yes, even you at the back) and instead gather round for tales of woe working with Microsoft Word. Depending on your age, the song title ‘Word Up’ will either remind you of a bloke in a red codpiece, a Scottish rock band with a left field cover version, or possibly, Little Mix, (according to Google). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |