
Open Source Chat - {gt} with Rich Iannone
Join Rich Iannone, maintainer of the {gt} package, as he takes questions from the community about the latest in {gt} v0.7.0, and building great looking data display tables with R. Key Resources: ⬡ Get started with {gt} - https://gt.rstudio.com Reach out: 38:48 - How do I ask Rich about {gt}, feature requests, bug reports, how to solve a problem via {gt}? Rich and the {gt} team would love to hear from you. ⬡ Feature requests & bug reports with GitHub Issues, https://github.com/rstudio/gt/issues ⬡ GitHub Discussions, https://github.com/rstudio/gt/discussions ⬡ Ask the community a question, https://community.rstudio.com/tag/gt ⬡ Follow {gt} on Twitter, feel free to reach out and ask questions, https://twitter.com/gt_package Timestamps Rich Iannone Introduction. 03:52 - Why {gt}? - What does {gt} bring to the table? Why so much effort into static, data display tables? 05:50 - Why open source? Why is {gt} open source and why have you dedicated your career to develop open source software? 08:30 - {gt} v0.7.0, Tell us about those new vector formatting functions in {gt}. Why did you include them? Could you show us some examples? {gt}'s vector formatting functions help you customize the styling, look and feel of your values. Converting the output values R gives you, and making them look exactly the way you want them to can be tricky. A lot of work was put into {gt} to give nice value formatting options. You can now access all these outside of a gt table; e.g. in text, in a plot, etc. 22:35 - Could you provide an example or two with the new styling function called `opt_stylize()`? What kinds of tables can you make with that? Can you extend that with your own tweaks? 28:15 - Can you make your own themes and share them? "How do I create my own custom theme for my table? A theme I can share with the rest of my organization?" 31:58 - What is the distinction between tab_options and the opt_* functions? Why would a function be in opt_* and not tab_options? 34:00 - sub_values() function, to find and replace certain values in your table. 36:50 - What is the current support for latex in {gt} at the moment? "Personally, I much prefer HTML, but for scientific publications, we are asked to provide a LaTeX file." 42:50 - "In my work, I often produce A4 output in PDF, mainly with ggplot2 content. It would be nice to be able to combine ggplot + gt tables in a similar way {patchwork} works. Having the plot and the table next to it is very useful sometimes." 44:30 - Interactive Tables with {gt}? 47:45 - "Any plans to make applying of same style to several columns easier? Unless I'm mistaken, the locations argument of tab_style requires one to specify an individual column. See here: https://gt.rstudio.com/reference/tab_style.html#examples." Yes, supply a vector of columns or use tidyselect functions. 49:15 - "Excel output with {gt}? Would be a huge improvement. I often have to produce tabular output that can be easily reused. Usually it means Excel tables. So far I have mainly done this with Python and openpyxl or PyWin32 (through COM). A simple solution in R would be great." 50:20 - Support for additional output formats with {gt}? Excel, PowerPoint, etc.? 50:25 - {pointplank}, a package to methodically validate your data whether in the form of data frames or as database tables., https://rich-iannone.github.io/pointblank/. Check out the workshop materials at https://github.com/rich-iannone/pointblank-workshop 55:50 - "Are there ways to have grouped rows? I mean when repeated rows have same characters can we merge them to one?" 58:00 - "Is there an ability to add 'battleship coordinates' (e.g. column letters & row numbers) to a gt object? This is a standard for table across my org and I’ve been trying to figure out how to implement it." 59:59 "Do you have suggestions or examples of building out & applying corporate formatting to gt tables (e.g. adding a company logo, company colors, etc.)?" 01:04:30 - "With PDF/LaTeX output for wide tables, it does not shrink the table."
image: thumbnail.jpg
Transcript#
This transcript was generated automatically and may contain errors.
so thank you everyone for joining uh really appreciate it so this is uh the first this kind of a pilot of what we'll call an open source chat so what what is the goal of open source chat it's a lounge curtis a lounge excuse me yeah i brought my water too so this open source chats okay or lounge yeah there's two main goals i am curious what you guys prefer so first and foremost goal is just to connect users of the tool to the people who develop that tool so developers can sometimes feel a little disconnected from end users it's probably not a case with rich here and then users often you know are unaware of how these open source software tools get made and get maintained and then open source software just works better with an active and engaged community and a better connection between developers like rich and end users like yourself or other contributors developers like yourself and then secondly just thinking this as an opportunity for you guys to share with each other how you use the tool and how you approach common problems.
so with that in mind we would love to hear questions from you i'm curtis i work at RStudio soon to be posit on the community team and we'll introduce rich in a moment also a good portion of you may be watching this in the future right after the live event and you know i like to imagine this post-apocalyptic landscape in the distant future where someone has somehow got access to a youtube data center or something um if you have those questions just go to the gt package twitter accounts rich would be able to respond to you there it's a good account yeah yeah cool.
so just introductions um so this is rich uh he's on the RStudio's uh Quarto team soon to be uh posit where as as you may or may not know RStudio is changing its name to posit for a number of reasons and is the maintainer of the gt package the gt package strives to empower anyone to make wonderful looking tables with r the philosophy is we can construct a wide variety of useful tables with a cohesive set of table parts and then this is done uh with a r package that has a number of helper strives to be intuitive and easy to use and helps you make kind of custom tables so there's many helper functions that help you modify and customize your table.
it sort of assumes where you start with this data frame and then a table is built up of stubs summary rows titles of titles columns headers footnotes source notes and then there's a number of formatter functions for the values of that table and then uh the other goal is to have to offer you a wide variety of output formats currently supported is html pdf or latex uh i think it's latex to have pdf rich checks rtf files uh which i love that it's called rich checks files since we have rich here and then recently added is was word doc.
so most questions uh will come from the audience but we have pre-arranged a bunch of questions just to kind of get things the ball running but we we do intend to switch to this discussion and questions from all y'all and then so if you work with gt actively now if you have feedback if you're struggling create tables that you need this event is designed for you it's very much interacting with with rich as the maintainer of the gt package so yeah thanks for joining us rich yeah thanks for having me this is great the inaugural lounge event yeah i really appreciate you doing this uh pilot and experiment yeah and i and i also really appreciate everyone who's joining us as well.
Introductions and background
so just the first question to get out of the way is um how do i pronounce your last name because i recently learned i mispronounced it yeah it's a tough one time um i go with ian or you know it's tough in is probably the best your best bet so ian none as it's basically spelled here but yes yeah yeah okay awesome.
so i should know that next serious question is i look back at your talk and i think 2019's uh our studio conference you joined in 2018 i've been working on this since may or march of 2018 more like me um yeah yeah yeah so i mean if you could i gave a little introduction to gt if you if you could kind of give your introduction and and why are you spending so much time on the right you know why are we why are you investing so much into this yeah i think it's mostly because there's so many problems to solve um i worked on it um we had the initial release like in late 2018 and then soon after tons and tons of issues um which was great you know i love issues um but they're all sorts like little things like that some things i thought of but some things i didn't and i'm still getting these issues even with lots of like um changes and tweaks and additions uh i think there's just so many things that people want out of tables because it's kind of a creative pursuit and um it's a bit like a visualization in a way there's no like hard and fast rules you can do whatever pretty much as long as you have some sort of grid of numbers or uh or you know otherwise but yeah there's tons of stuff to do so i just kept doing it nobody told me to stop.
um yeah and there's so much to do especially in just a static table um scenario just like you know tables on a page or on a website um yeah yeah i think we're almost getting to the end of like the conceivable things that people want that's why i'm sort of shifting my attention to like other things like um you know those questions i had you know branching out yeah other output formats or getting interactive um but i still i still think there'll be a lot of work even in the non-attractive case because there's so many small things you can do uh to make better.
and i i have a kind of a set i warned you about this question it's a little bit vague but okay um just to set things up right as a company what one of our goals is to support open source software for data science so can you tell me like you know you could conceivably working as a developer at a fancy software company not that posit is not fancy but yeah so so why are you investing so much into open source like why why is this an open source package why why do you care so much yeah why do you open source in general i think it's great because you have this um interaction with the community you get like issues you get to talk to people on issues you get prs people are sometimes sitting in their first or uh maybe they're experienced you know we have different levels of people coming in uh but it's great you're helping people sort of like you know contribute it's like all about um interaction and contributions and uh it's great to see something like develop kind of like semi-organically that way i know like you know like the maintainer probably but it can be totally steered and shaped by by people in the community and i think that's kind of wonderful in a way.
it can be totally steered and shaped by by people in the community and i think that's kind of wonderful in a way.
so what would be your message to why right if i have some options for developing a any sort of software why as a user would i maybe prefer open source over some alternative that's not oh yeah yeah yeah lots lots of reasons um well one thing is like if you see like a thing that you want or something that's not quite right it could be a bug or an enhancement you could just make the pr and convince the person to accept it or you know like work towards getting that accepted and that could be really fast i've seen it happen within a matter of you know in best cases hours um you know sometimes it can happen over a longer period but it'll happen way faster than closed source software i can tell you that at least have a fighting chance with open source and like if the project is active um it's extremely fast it's it's amazing actually how fast you can make changes and how much you can sort of help a project out just if even if you're on the outside.
gt 0.7 — vector formatting functions
so as a reminder to folks um feel free to ask some post some questions into into the zoom chat as well as if you're keen on more of an anonymous type structure um there's a slido link at rstd.io slash os chat feel free to drop stuff in there um the second half we'll switch to discussion that sort of thing um just to get the ball rolling uh we've set up a couple questions uh focused on gt gt 0.7 just came out um could you kind of introduce you know what's in gt 0.7 and tell us a bit about what one of the parts right is this vector formatting functions yeah that's kind of a big thing um okay there's two like really big things uh the first is uh the first support for docx output like word output format it's not just beginning so um you know keep your expectations not too high because it's just beginning so there's going to be a few like sort of like things to sort of like patch over uh but at least it's a start so we've got that sort of going um the other thing is yeah this uh the vector formatting functions um and i can show you that because it's kind of big thing so we spend a lot of time making these formatting functions so you can get your values and whatnot formatted just like how you want them.
i'm going to share my screen and i'll show you i got this like document i set up and it's got all these things in here and it's actually a lot of functions if you look at these these are all the functions i added in in 0.7 they all begin with vec underscore fmt so the existing functions are just beginning with fmt um so those are already in the package like pre 0.7 but we add these ones that begin back and continue on the same name so the idea here is you can just like use those formatters uh outside gt if you want um so you have a vector you just format it and you have the same arguments that you would have uh in the sort of like the function that was there before.
so it's better to show than to tell because it's a little confusing um so let me just show you so i got this vector of numbers just uh you know some some numbers and i'll use vector format number on this and then if you look at my console it just formats them to two decimal places because that's the default uh for that so i can change that to like three decimal places so kind of neat so we're totally outside of gt we just have a vector and we're using the same functions that you would use to format columns of values we're using outside so why do this well there's this thing called r markdown in Quarto or you know other things like that you may just want to have formatted values in your text so you can have these inline sort of like um r pieces or r chunks and you just throw in like a vector like a vec format function in there and you know get the same sort of treatment as you would in your table which is super cool.
uh so i'll show you a few more examples just to acquaint people um so you have some options here for the separator mark and the decimal mark you can change those so basically those are reversed um so other you know locales will have that by default so you just insert the locale like here's france and we have the same sort of thing right there that takes care of that there's a bunch of options basically the same options as i said that are in format number which is this function here.
um so if we did this for sign equals true just a few more examples that means like you get a plus sign always that's pretty good if you want to show change from a value uh drop trailing zeros so that means like any zeros that are at the end will be dropped accounting we have that and you can always use a pattern if you want to adorn your values with some sort of text either before or after so that's like a sort of review um and it's kind of neat because this is just like in the console we're getting our values just formatted.
um this reminds me of scales a bit like you often have to pull in scales yeah ggplot2 exactly so we have vector format currency and we do the same sort of thing with num bells and speaking of which there's in scales sorry um dollar and you can do the same sort of thing like uh num bells i believe works same sort of thing except in scales there's only dollar and euro i believe and there might be pound but uh you know vector format currency has basically every single currency type so which is kind of neat so you can just choose the currency in there.
um so that's kind of neat so same sort of use case um if you're using this outside ggplot2 just inside text uh you can use these they're sort of interchangeable uh which is kind of neat yeah i can i can imagine you put a ton of work so that you your users could customize the look and feel of the value within the table that's yeah i you've showed me you know i've gone through sort of if you include all the parameterizations and all the examples of those we're talking about hundreds of different ways to look at things right and so basically with this is it's now available outside to anyone so you could put it into a ggplot2 or a plot exactly or inside text inside in line or bit yeah.
um i'll show you a new function we have there's actually two of them because you know we have this two like a set of two now uh format duration and vec format duration uh it's kind of neat because i can just like provide examples with the vec form and just show them the console it's kind of like a nice way to avoid seeing a table each time um but this is all about duration values um you may not use them very much but if you need them this is great because it provides so many different ways to like provide these human readable durations uh so like you know 81 weeks two days 20 hours 24 minutes 32 seconds it kind of does that automatically uh so i don't know if you know about diff time values but there you can use those or you just use numerical values and provide the unit so two different ways to sort of like put your inputs into this.
uh but there's like tons and tons of options here so again i use that help a lot uh if you just go to format duration uh you'll see just a pretty large number of like different like arguments for tweaking um the values and of course i provide examples here at the end but let me just show you a few of these just to give you a flavor of what's in there so we have that uh we can also like just constrain the output units so this in this case is just days we can provide a vector like that and we can also it's a little bit off the page here but change the style duration there's four different styles so y just means we're not using h or m we're using like the the words essentially like this which is kind of cool and uh a big thing i do in gt is because i know this package goes all over the world is have locales like a locale setting in each writer function and that should basically this is not a machine locale it's basically independent from your actual setup but if you put yes it'll produce like spanish um durations which is kind of cool.
if i build a shiny app and i somehow collected locale information from the user is that something i could pass on or is that sorry that's yeah absolutely yeah like there's tons of lookouts so if i just change this um like it's that so it's like i think 700 and they're all translated and formatted correctly uh because there'll be all sorts of like differences in the way this is like patterned so so a lot of time went into that uh making sure that worked.
so but i'm really happy that we have all this like for every single formatted function now um we also have another one i just want to show you one more it's the scientific one because i want to draw your attention to like some special stuff at the end um okay first of all scientific notation a new thing is now we have like a plain version of like scientific notation so this right here if you look at this uh it's just basically like meant to be sort of like inline in a console this is called the plain formatting style and you don't really know this but by default there's actually a output which is called auto so in the console it'll just be plain but you can force that to be like plain like this um so i'm just going to zoom ahead and sort of get at what i'm trying to show you this output argument it now like can make the um it can make the outputs like html latex or rtf so i'll show you that because you know this is stuff that's kind of hard to type out or to format yourself but if you have an html document it's perfect because it'll be formatted nicely if you have a latex document same sort of thing sort of stuff that's a little bit hard to write yourself maybe impossible to do in like gt right now anyways rtf is right there so the idea here is because we have it as auto we can just put this in like Quarto and it'll detect what the output is and it'll just choose so if you have an html document in Quarto it'll choose a nice formatting which is basically using tags.
so let me show you that um so i haven't i had no idea that yeah that's amazing yeah there's like so much stuff going on that's why it's like oh my god i gotta show you all this uh so we have a Quarto document right here so we're just setting it up with a gt and tidyverse uh we're making a table uh there's a nice data set inside gt called pizza place i make a pizza summary i make a table and then i display the table finally great okay but the thing i want to show you is the new thing basically in this little inline code chunk uh with the backtick r uh so i've got an object pizza summary which is a table and i'm pulling a value out of it and then i'm getting the max one the the max element of the vector and then i'm using one of those vector for my functions and i don't have to like specify like the type like the output it just auto kind of knows um what we're doing but this is really kind of neat because like it gives you like the html like formatting and with diagonal like as a layout it's got a nice slash and like the number on the left is superscripted and subscripted on the right kind of hard to pull off if you're just doing it yourself.
um but you can do it here which is kind of cool um and there's also some a bonus as well in version 0.8 which is not released yet but it's in like the dev version we have another function called extract cells which allows you to just from a gt object take a format cell right out so you don't have to like redo all this stuff uh so there's like two ways to to do things so basically the formatting that's applied will just be like taken and put into the uh into the document let me just show you that i'll render this yeah i feel like you've been setting it up and teasing last setup yeah but uh the final result will be really cool but it's good to see like you know where it's coming from and you know the source and the output okay so here's the table well here's the source for the table the table so you can see we have fractions here nicely formatted uh really cool but here in the text look at this uh 5 over 10 in that sort of fancy html way so with tags uh same here what we did here is 2 out of 10 because we've targeted the column f sold you don't know what it is because it's actually um you know like right here in this pizza summary or actually no it's in the gt table and then um rows 14 so we just grabbed row 14 which i believe is the last one and it's 2 out of 10 so basically this formatted value you don't repeat that because it already knows what the formatting is you just start grabbing it and then putting here which is super cool if you want to cite values in a table you don't have to like you know like run the risk of having formatting errors or like transcription errors you just like you're just pulling it which is kind of neat.
opt_stylize and theming
so yeah in gt in in 0.7 um there's a new opt stylized function which is sort of like applying i mean you're about to show us but it's sort of like applying sort of a theme to a table so you could have multiple tables with with minimum effort to kind of have different similar looking tables or similar themes applied to it so yeah could you provide an example yeah with the new styling function uh yeah what kind of tables can you make with that can you extend that with your own tweaks um and then second part question which i asked you and i know i've seen uh is you know similar to ggplot2 themes where it's really easy to build your own theme is there what kind of support is there for that now for building your own theme like a company theme or a personal theme and uh applying that yeah so thanks yeah i can definitely get to all those things uh so yeah the new opt stylized function it's great um i mean let me show you so i'll make a table and i'll show you that table we're finally seeing a table which is kind of cool um so i'm gonna run that and get it right here in the viewer okay so here's my table um so this is just like the default you look like just a plain table coming out i mean there's a bit of formatting there's like all the different sections like summary rows this is a grand summary as you can see by the double line and it's got some like you know it's got a footer section a title a stub on the side and group summary rows great it's got all the all the all the parts are there uh but now we can we can style them uh so yeah we do the opt stylize and look at this there's like so many options because there's six colors uh that we chose and six different styles that makes three six different you know like jumping off points so so let's let's show you a few of them here's one okay so look at that uh so it does styling and that's in the blue color we have cyan i'm just going to run through them pink red and gray.
so why do we have just these colors the reason is we want to sort of carefully curate this in order to get maximum contrast uh between like you know like the text and the background colors and just to get some sort of harmony we chose actually a number of different hues and it's more apparent we look at different uh like the different themes like the different numbered styles like for instance this one it has like a dark blue and a lighter blue and uh perhaps even lighter blue or yeah something in the middle there's actually five different hues for each color and um it's interesting like i called these styles one you know just one to five and then just last night when i was like preparing this i was like maybe we should have names for these different um styles so i took a stab at this you know like this is like almost a colorful stub because at least you do get a color there uh this one draws your attention to the summaries because both of them have a background color uh this one is dominantly gray but it at least has some color at the top right there and this one has you know a different style in terms of like dashed lines a few of them so i try to make it a little bit different so you have jumping off points because this may not be the thing you really want in the end like if it is that's you know it's fantastic um but it might you know it might need some tweaks right but the great thing is you can do that uh because all the changes you make are sort of like additive in the end.
uh so we have this example table for instance and we use off stylize uh style five color green looks pretty good uh but maybe you don't want the row striping you can sort of see that here in rows two and four and further down as well uh we can give her that just with opt row striping false now that is going to be gone oh sorry i included the pipe try it again there we go so that's it that's a tweak we made so away from like the original sort of like theme uh result uh maybe you don't want the outline that's around the table you can move that as well great now we're getting somewhere uh say you want the table header to be aligned left no problem we can do that nothing else is disrupted it's basically just like independent of everything else and maybe you want some other options like and there's tons of these i kind of like i am both proud and also a little bit embarrassed about how many options are in tab options so it's a bit unwieldy but it gives you at least tons of control like over the look at the table and it's not hard to use once you know where to look.
so for instance can i ask about that as yeah kind of a design question uh why are you embarrassed about that like are you suggesting there's like an alternative article it's you know it's massive uh so tab options um i mean this is an area where we can like we can just scroll and scroll and scroll i mean this is okay i mean i think ggplot2 has something similar to this otherwise yeah it breaks it down a bit more um but you know it is at least all in one function it's kind of like um it's a lot and there's lots of explanation at least but you know like i can understand it would overwhelm um there's some examples more than the usual amount but i believe this deserves like an article um just to you know go through all these things but if you do need to change things table-wide and not have to resort to like targeting specific areas with tab style uh this is a pretty good place to go so for instance we can change like the the vertical lines and just get rid of them like none uh we can uh add a top and bottom border to the table so let's take a look at that whole thing there we go so now we have that that line there and this line down here at the bottom.
and the theme it's weird it has like invisible things that are not turned on so um if you do turn them on like this it'll be part of the theme although it's kind of like not there sometimes it's a bit strange um but yeah so this is an example of like taking it further you know starting with up stylize and then you know like uh tweaking to your satisfaction so if you're like a company and one with one like your logo in there um you can probably do that just by inserting like an svg or some sort of graphic in the header or above that um unfortunately i don't have an example of that um but maybe i'll have that for next time because that seems like a pretty obvious thing.
uh okay more about theme so say you wanted to do this all the time you could definitely make your own function uh so i have a function here called my theme uh pretty simple all i did was i took this right here replaced example table with data but that's you know the only argument in the function of my theme and then um this should totally work i mean even if you don't have these parts like if you don't have like a tape um like a header this the function won't stop it'll just do with it what it will and not error out so this is kind of cool so my team we have that function here's the example table and here's the example table with my theme there we go.
and is that additive on top of it too like if i wanted to then suppose there's a company theme and i then wanted to tweak it you can keep going yeah you can add different options you can have as many tab options calls as you want like that so yeah definitely um so yeah i think so even more about dating if you really want to make your own thing and maybe bypass up stylize you know just go a different direction you can make you know i call this function my super custom theme same sort of idea data is like the argument you can call anything you want it's basically just the gt table and you know use tab options and again it's huge but it kind of like lets you target different areas this is just at random so it's gonna look it's gonna look terrible but i want to show you this oh and also isn't this cool like the new ide for RStudio shows the colors that is so incredibly helpful um because sometimes i'm just guessing and if it shows a color it's like oh yeah i got the color right so yeah let me show you that so this is my weeks that's helpful yeah but yeah still yeah like i'm just guessing old names that i might know okay so here's example table and this is with my super custom theme apply there we go so basically it's like making your op stylize function in a way and this is kind of what op stylizes mainly doing in the in the body itself of the function sort of an inside look.
where do you think development is going to go with this um i i've told you about this before i've seen one one or two message on twitter where yeah like i like the ggplot2 is sort of a really nice standard as i understand it's a pretty good nice standard um is this sort of the way you're going to be encouraging people to have this sort of uh theme that you could apply to multiple tables i think so i think so like you can either do like you know just have like the different you know statements or you wrap it up in your own custom function i think this is the way to go and just maybe some more documentation around this because sometimes it's hard to imagine you can do that um yeah or whether it would work really well but you know having a little recommendation there in the docs would be uh my next step with this because i think the model is not bad i mean you can overwrite things it's kind of like a settings table which is just basically like you know like just set i guess or and yeah it's nice that you can sort of iterate rapidly you know with this and run the function change a few things run it again and then you have a function you can use over and over again.
Audience Q&A — opt_ vs tab_options, LaTeX, interactivity
um we have a bunch of questions coming in and some we'll get to in a moment but one is actually very much uh fit to to what we're talking about now um so max actually max would you like to ask the question it's i mean it's just based on what's on the screen right now uh sure thanks yeah um yeah first great prat great package um some really cool things here but i was just wondering what the kind of design distinction is between having a function in the opt set of functions opt underscore and then having tab options like why would something be in tab options and not op stylized yeah yeah i think part of it is tab options just being so big it's hard to find important things out of that so basically what we did with opt functions is try to elevate a few things that were hard to find or it is a combination of things of different settings which are changed in tandem which might be not you know incredibly not obvious at all uh like for instance uh well i'm not gonna go through the code but the opt stylized that changes a bunch of things in tab options that and provides a simple interface you just need to host a style number and then just have a color that's you know one of the accepted colors it'll change a bunch of things for you to have options you'll have to hunt through them and like especially settings there's like at least like two dozen things which are changed with just this function um things like striping it just that is less the case i mean there's probably an option inside uh tab options that does that but this just elevates it and exposes it makes it a little bit easier to find and discover so that's some of the things either it's like way too complicated or it's hard to discover those are the things that sort of warrant or maybe think that the opt functions you know have a place in this package okay great thanks.
so first anonymous question is uh yeah what is your current support for latex at the moment uh personally i much prefer html but for scientific publications we are asked to provide a latex file and then also i guess fitting to that what would be your suggested workflow like a lot of a lot of docs are sort of assume i'm going to do everything in our markdown doc or everything in a Quarto doc and that's my the thing i submit but very often you know i just need to make a table that then a co-author uh incorporates into an existing you know highly customized latex doc yeah so you're sort of exporting it out you're using gt as a tool to make that table but ultimately you're going to take that code and put it in a different document that sort of away from like r markdown or Quarto yeah i think with latex we want to make it better it's not nearly close to parity uh with html as it could be i mean certainly some things that are in html can't be in latex because it's paginated but a lot of things can't like cell backgrounds and changing colors and having just raw latex text if you want to circumject that that's sort of missing um the reason why it's missing is because i didn't see there's much demand for that yet usually when i look at the latex tables um they're pretty unadorned with things like color and other things like that they're pretty much almost like box center tables i kind of have to wonder if that's because it's just really hard to make tables with you know all sorts of things in it because you have to use packages and things like that um but i almost feel like if you had the option maybe some people would use that so it's kind of that weird standstill right we don't really know how much we need to do in that if it's you know like if that export option is satisfactory or not certainly i get the indication that it's not quite there because some people prefer to have at least those few things in there.
so i think we'll address that i'm gonna be asking you this a couple times uh yeah if i was a gt user or potential gt user uh what how do i let you know what i want and need or would like lots of ways yeah lots of ways so yeah the latex tables are a nightmare i understand um basically uh issues issues is a great obvious way uh other ways is it captures things and sort of puts it on the record and it's actionable by me uh another way is the discussions inside the github repo for uh gt there's a a new sort of feature it's not that new anymore but it's basically a part of github it's called discussions if you feel something is not really like an issue or you just have a question or something like that put it in there other places rstudio community usually i see all this stuff so that's a great place um stack overflow is not that bad because you usually have other people answering your question quickly and it may be just like you'll find it's a bug so you'll just end up you know you might end up like posting that bug as an issue in in the gt repo uh so lots of ways um those are the few obvious ways it could be like twitter as well like on the gt underscore package account.
um you've listed six ways so yeah like the only next option left is like you can get your email out or something like that yeah exactly call me up yeah yeah no i mean yeah those are those are pretty good ways i definitely see them like every single day so if if an issue comes in i'll try to triage it and uh reply back and at least like sort of like get that like sort of like in a milestone and you may not see results for a while but maybe you will maybe you will so this is a call you'd love to hear those types of suggestions or feedback yeah well absolutely either improve the docs if the feature exists or put it on the on the pipeline uh if it becomes a priority yeah and i just had like a few recent issues about docs about sometimes certain parts are confusing uh you know they don't read well i love stuff like that because like i want to know what's confusing like maybe at the time it was even confusing to me but i just you know sort of had to you know put that in um but and sometimes things need revisions just because things change in weird ways and you know the docs get stale but i definitely want to hear that and it seems like also if you're willing to like make a pr i would love that too because like i can guide the pr process you know make little changes make suggestions whatever your level of comfort is with a pr especially for things like docs because that's like easiest sort of way to like make a big impact it's just just changing text really.
um yeah i love all the issues i love i will i will work with you to summarize these this kind of advice and make sure it's in the video description as well share it afterwards um there's a quick question from slido as well so this is not gt related but when you showed the um color highlighting in the RStudio ide um yeah how do you turn that on or is it just or i guess what's that feature i think it's automatically turned on there might be an option to turn it off i think there is an option to turn it off but with mine it was by default on and where i got that was from RStudio daily release uh so if you go to dailies.rstudio.com that's where all these um you know very recent like builds of the ide live um they're pretty they're pretty stable i use them once in a while just so i can catch up on what's new uh but i really you know some of these things are great like the color thing is like a dream i never asked for it but i don't know i love it it's nice if using color is like and you do that in gt a lot so it's great to see that it's verified that you're getting it right.
um so another question um from actually is is i'm going to mispronounce your name sorry but is erdi here erdi i asked a question early on give a couple more seconds and just read the question yeah cool well uh kind of earlier in the discussion um erdi had asked uh in my work i often produced a4 output and pdf uh mainly with ggplot2 content it would be nice to be able to combine ggplot2 plus gt tables in a similar way uh to how patchwork works um having the plot and the table next to it is very useful sometimes how would uh interactive gt tables be different from reactable i guess that's different i said actually topic we'll get to in a moment yeah yeah yeah but for that first one uh gt patchwork i can totally see the the appeal of like arranging plots with tables in a sort of like nice way um i think some early sort of like looking at that was done um we'll see by ellis and i believe tom as well uh so we're looking into that it seems like a difficult thing kind of like one of those high difficulty but high reward sort of like projects um although it does seem like it would be like a slam dunk if you got that in as a real feature i mean there's so many things chris but that that that is like a good one especially um you know as it relates to like our new publishing endeavors with Quarto um and i'll actually check in to see if like Quarto could do some of this as well as a not as a replacement but as a another way of like arranging like these things together um but yeah we're looking into that essentially is the short answer maybe not a very satisfying answer that's fine.
um so uh another kind of big theme um so you know ahead of time we had posed this quick the kind of a question on on your on twitter uh and there's a couple similar questions in here as well um let me set this up yeah basically would you like interactive tables with gt there's there's been a couple questions and and at least one question in in um zoom and slido and then these as well so yeah i'm kind of curious what your thoughts are on the ability to add interactivity reactable is obviously very is already very popular for doing uh creating interactive or you know having having interactive features added to a table so yeah i'm just curious what your thoughts are um yeah i'll say like this is like a thing we want um but we never focused on to highlight a couple big points right is search in fact my you can see my comment there is the third one um you know search and uh kind of column filters that sort of thing yeah well the great thing about reactable is that we can use that as infrastructure for gt i actually have a branch um it's not really a pr yet but it's like an experimental branch of gt that has like interactive tables and it basically uses reactable under the hood so we can apply the same sort of api things that gt has but just use reactable as the engine for producing tables.
to make this work nicely we have to make sure that all the styling and all the things that you expect come through um we have to know like you know like not no but we have to figure out you know how summary rows would work inside of like this new interactive table maybe they don't work but um we want to make sure the look and feel is sort of retained but still using like you know like all the work that's been done reactable because i think it's kind of like a little bit not counterproductive but a little bit too much work to like reinvent you know like another like interactive table project just for like one feature so that's something i've been exploring and the early results are pretty good like you get all the features you get the searching you get like the filtering um you know like all that all that good stuff and you can turn them on selectively as you would with reactable uh it just you don't have to type on a bunch of reactable code you just use gt code maybe switch an option a few more things and tab options for you know switching things around and then you're pretty much there in the same place can the community help in some way or start testing things out yes yeah my first thing is to make that sort of public as a pr and make an issue that pairs with that and then just that you know like illicit comments um from the community i think that'd be great yeah um and then you know publicize that a bit so people actually know that it's being you know done um yeah yeah that'd be good i'll have that i'll have that going like this week actually no it's actually good thing testing it recently and like it's a thing that's constantly asked and you know it's a big thing but to be able to push across the finish line you just have to like you know you know get back to it and you know work on it so yeah that's great that's great.
uh there's another question from zoom uh is arthur still here would you like to ask you sorry you asked it uh probably at least 40 minutes ago so if i can't catch you this is what the question was i'm dropping into chat right now okay uh is arthur there by chance yes awesome hey yeah so the question is is is this so like gt has this nice way where you can kind of style um rows that may kind of defy a certain validation rule let's say um but currently it seems like one needs to you know add a new tab style per per rule are there any thoughts for making this easier like um i don't know something like dplyr dplyr across or some other way of like kind of implementing this across several like applying to several columns yeah i believe you can do that um you have one rule for how you want to style and then you have multiple columns you need to use a vector of columns or you could do a tidyselect you can use where uh you know like where is numeric for instance would be one thing um yeah let me know if that doesn't work because like my current understanding is you just supply a vector of columns or any sort of tidyselect statement uh should do it i believe if you do that the columns all have to exist uh no actually if you just include a vector they all have to exist if you're using tidyselect they don't you can use like something like begins with or and starts with or ends with things like that um does that answer your question yeah i think so thanks i'll tinker and come back to you if yeah if it doesn't work as expected yeah yeah it doesn't work definitely let me know.
Excel output and upcoming features
so i i there's another question that i really wanted to ask you um this is a question that came from linkedin from sean claude um and the the what the what part of the reason why i want to bug you about this is uh when you gave your talk at our studio conf in 2019 you had a question for the audience that was this as well yeah so i think i yeah so excel output is basically the question it'd be a huge improvement i often have to produce tabular output that would be easily used usually it means excel tables so far mainly do this in python with some libraries a simple r solution would be great preferably with full control over cell numeric formatting borders merge cells replacement that sort of thing if you could do that by christmas that would be awesome yeah i've heard this a long time ago i wasn't sure how many people would do this because there was already solutions in place for doing this but not really right like not with the api that gt has um so this may be a thing like this would definitely come way before like something like powerpoint that was also asked for um so yeah and it's not in there because you didn't ask for it exactly what type of table output are you so doc x is big i'm thinking like anything office is kind of big because like office is big so um but i'm hoping with the new doc x uh stuff that we have in things like powerpoint and excel are not too far off because they both use xml and we're using the xml basically it's open x open xml uh cogeneration to to create that word document uh nice so it might be yeah it might be close like it might align like very closely with excel as far as i know like each tag has like the name of like the office product in the front of it and then like you know it's used but i'm not sure if there's like different arrangements of the tags depending on the upper format but i want to say it's pretty close um so it may not be something that's like totally like new and like an entirely like separate project it might be like just part of like the the word or office project as it were so i'll look into that like the first part is for like investigating you know like like how much work will be like an estimating but i've heard this time and again like excel is kind of like a big thing so it's you know it's kind of impossible to ignore at this point so yeah basically i'm going to look into that as well.
Wrapping up and how to reach Rich
cool we we just got a bunch of questions coming in um with four minutes left so first off are you able to go after like it'd be nice to maybe do we could do a little summary for at the hour of uh how to get in touch with you kind of go over those the kind of calls to action you might have and then uh you know whether or not those folks are able to stick around we could at least just get those questions answered so that there's a record of it um yeah so first off uh in in the video description and associated with this you kind of went over ways to get in touch with you um and so we'll share those as well i saw isabella actually shared those in zoom chat yeah um i did want to call out something as well uh tomorrow right you have a workshop at r and pharma it's free

