You
Everyone to today's webinar we're going to talk about
reproducible examples from a conceptual point of view and why they're
Surprisingly important and then also a great deal from a mechanical point of view
how to make your reproducible examples in a way that they're easy to share
With other people this short link the R stood that IO
Repre Comus it will always point to something very relevant to this package that will link to absolutely everything else
So the first thing I want to do is show
Basic usage and we're just going to get right into it and then we'll unpack what you just saw
So I'm sitting here in an art studio
Session it's fresh and I have a little bit of code up here and my source editor. I'm gonna make a
Factor X a factor Y. I'm gonna combine them and
And get what to most of us is kind of a puzzling result
so this is just going to be an example of a small piece of code that
Maybe you want to talk about on the community site or share with your local our expert and ask like what's going on?
So this is how you would use reference to turn this little snippet of code into a reproducible example
This is the path of least resistance. We'll talk about other methods later
so I would select a little piece of code and
Copy it to my clipboard then over in the our console
I'm going to type rep ryx and
You will see that that little piece of code is run and then basically a beautiful attractive version of that is
Stored on my clipboard and I can preview it here. So if I were to
Paste the contents of my clipboard right now
you actually see what's called markdown and this is
What's necessary to create the attractive version of this code? And why is this helpful because you can go
to places like github the art studio community site or Stack, Overflow and
Paste this markdown in so I'm going to show you
What this would look like in a github issue so that's that same markdown that you just saw
Github lets you preview things and you'll see that it looks just the way it did locally for me. It's been rendered
It's syntax highlighted
We have a tiny little ad down here that tells people how you did this and I could submit that as a github issue
so that is the basic process and
the reason I can just type repres is that I always have
this package
Attached and so you might need to call this and we're gonna talk a great deal about that
Next so that is what basic repres usage
Looks like it creates a small little piece of code renders it nicely and it's ready to paste into other formats
so this is just a static version of what we just did and
This is the gift that I use on the recs website, I rewatched this clip that's from a movie called Jerry Maguire
It's still highly recommended
And basically the reason for bothering to do all of this is if you're going somewhere to have a conversation about are
To have questions answered or to describe a bug in software
Being careful about how you make your reproducible example makes it much much much easier for other people to help you
and
I want to explain where this word came from repres. So Roman first tweeted this and I thought it was just a
Great made-up word. So it is short for reproducible example, so it is a completely made-up word
But it's just very handy and I'm going to use the word repres over and over and over again in this webinar
so I want to be very clear that I'm
Using it and I'd say three like distinct but related ways. So I think people at least in the
small art community are starting is to say repre kissed as a noun like it is a reproducible example and
That has nothing to do with whether you use this package or not
But then today's webinar is going to show you use of a package with that same name
Repres that you can install from cran. I'll show you how to do that in just a moment
And then this is a pretty small package
It has a couple functions but really the main function it has is also called rep. Ryx
So this webinar is going to talk about how to use the rep recs function
inside the reference package to produce a good-looking reproducible example and
When is this come up in your life? It's very handy for conversations that you have on
community our studio comm
It's very handy for preparing questions or answers
for Stack Overflow
It's very handy for reporting bugs or making feature requests for an hour package that is developed on
github and
also, very useful for having
detailed conversations about our and slack or an email so a
Reproducible example conceptually is useful in all of those
Places and then this package rep. Ryx
Smooths over some of the mechanics so here I wanted to talk to you about what you're going to need to do on your computer
To make this package available to yourself
So reference does not come with our it does not come with our studio
You have to make an explicit effort to install it. So
You should pick one of these methods and it's the type of thing that you do once per computer
So you could use install that packages open quote wrapper X close quote
To install just the rep Rex package it
Is also part of the meta package that we call tidy verse. So if you did install that package as tidy verse
Repres would be one of the many packages that get installed on your machine in general
There is very little harm that you can do to yourself by reinstalling packages. So you also should not stress out too much about
You know, you could stop you could install just repres and then install the tiny burrs and nothing bad will happen
So do it once per machine just because that's the minimum you need to do
But it's no tragedy if you reinstall things once you've installed you still need to use our sort of library
Call to make the recs functions available in your our session so you would need to do this in
Every our session that you plan to use refworks in so that might be something that you do
Multiple times per day certainly way way way way more than once per computer
so every time you want to use the package you'll need to
Execute the library repres command
Now I use repres several times a day in the most part. And so that would be very annoying
so an alternative if you also have a comment semi-heavy user of this package is to
Make it available to yourself all the time
so you can control the start up behavior of our
through a file called our profile and
conventionally its found in your home directory and
So this snippet of code?
Suppress messages require reference looks a little different from what you just saw
But it's sort of a better way to attach this package in your in your startup file. So
you would put this snippet of code there and your our profile and then forevermore when you start our
the wrapper X package would be available and
If you have never thought about your our profile file before
There is a function and they use this package, which you would also have to install
That will create it for you. If you don't have it or if you do have it it would open it for you
For editing in case you wanted to put something like this snippet in there
so once you've done those two things you've installed it and you've attached it through either the library command or
by putting something in your dar profile
You are ready to use the Rex function and what you saw me do in that first
Demo was I actually called the Rex function explicitly in?
our console and
Something you'll see me do before we're done is we also have put some what are called our studio add-ins into this package
That give you even more ways
To launch this function. I
This is a bit of a sidebar. But but since I have shown you how to put things in your our profile file
I also want to
Tell you how to do that responsibly
So rep ryx is a workflow package. It's something you would use in your daily
Work to make your life a little bit easier you use it interactively
I would be pretty shocked to see it show up in
A typical person's our scripts are markdown files
Packages or shiny apps and so the fact that it doesn't show up in those things
It's an interactive package makes it safe to attach and your our profile
But I don't want you to get the wrong idea and think oh my god, I should do this with all my packages
So I would not want to see this kind of code
Using like deployer ggplot2 or things that do show up in your scripts and it's because your scripts would then become
highly not
Self-contained and they they would work for you because of stuff in your art profile, but they won't work for other people
So this is an interesting technique to know about but you need to be really really careful about what you do here
So I think it's safe to put rep Rex in there. It is not safe to put deep IR in there
Okay, so we're going to get back to the package and to reproducible examples now
So I wanted to give a brief intro like what on earth in my life drove me to make this one of my missions
Before I joined our studio I was a professor at the University of British Columbia
and I had a course called stat 545 that
has a lot of content online to this day the course continues you could go there and
I ran this course entirely on github and
so it meant that
All of my dialogue with students both sort of me to the whole class and and me talking to individual
students
took place and github issues and
I actually analyzed my github usage and the course and I found that every fall I was
participating in at least
300 any
500 github issue threads and that's just in my teaching life
So I spend a great deal of time talking about are in those places and solving people's our problems
and
to do that
well
I actually wanted to use executable our code and the friction involved in making that look good started to drive me crazy
and
Now that I'm no longer
A full-time faculty member and I'm working full-time on our packages
This just gives you a sense of the intensity of my github activity over the last year
So now I can still work with tons and tons of github issues
You know in a different capacity and then I also talked about our a lot in slack so I still have this
Sort of hourly need to run little pieces of our code
And share what I'm seeing with other people
So try to remove friction for myself and other people
Led me to create a few principles that I knew had to be true of a tool to make this easier
So this is the replica
la sofy I
Think that conversations about code are much more productive if they contain three things
Well, it's one thing but three properties
code that actually
runs
okay code that I do not have to run as the reader but
code
that I can easily run and so there is a little bit of
self-contradiction here
but the point is you want to make it easy for people to interact with your
Reproducible example in a whole bunch of different ways. They can just be a consumer
They can just read it or they can easily grab it and run it themselves
Modify it and share that back with you
So I want to be really detailed about what I mean when I say code that actually runs
So you're gonna isolate a little piece of our code and you hand it off to repres
You've seen one demo. We're about to do a whole bunch more
that code is taken and it is run in a completely new our
Session and that means it has to be completely self-contained
so it must include the command to load all necessary packages and it must create all necessary objects and
this can be very frustrating for people but it's extremely
important
So I'm going to go do this live if to show exactly
What I mean
Okay, so I'm looking at
An R script that contains the code you just saw on that side
And I'm going to restart R
So let's imagine like a typical interactive our session. So I'm gonna be down in the console here and I'm gonna say oh
I'd like to play a little bit with this crazy package I've heard about so there I go
I say library praise done on the console
Now up in my source editor I make a new object called template and it's a template string
Exclamation your rep Rex is adjective. And so if I then
Call the praise function from the praise package. I don't expect you to know this. I'm just using it as an example
It's gonna create like random little sentences for us praising someone for their awesome reference
So let's say I want to share my joy about this with people using the Rex package. I would select this little snippet of code
again
This is the long way. I'll show you a short way later. Copy it go down to the console
type repres and hit return and
Now, let's look at the preview here
It shows defining template and then my praise call fails error and praise could not find
function praise and
that's because
You don't have the library praise command here so over in that fresh our session
The priest package is not available to use
So here's something else you might do. You're like, okay, I'm gonna add that command. Then I'm gonna make my call to the package
Let's see if that works copy
Call rep Rex again, I
Have a new error error and grep whatever whatever objects template not found
So this snippet is incomplete in a different way
It actually doesn't contain the code that defines the template object
So here's the full snippet it
loads the Krays package
it defines the template object and it makes
This function call. So I'm going to copy all of that
to the clipboard
We execute that flex and
We have made an exquisite reference
and so that's a little
belaboured but when I try to answer our
Questions for people and I try to run their code the two most common ways that I fail are
that they haven't
Explicitly listed all the packages they're using and I have to either
sleuth it out of them or figure it out for myself and add those commands or
The objects that are referring to are not available to me. And so those are the two reasons where I can't run their code
So on the rep Rex website, I have a list of do's and dont's that are
Distilled from of other really fantastic
sources about creating reproducible examples which are referenced there, but the three big big high points are
You need to write this reproducible example using the smallest the simplest and the most
Built-in data set you can get away with and that is very uncomfortable for people. I'm going to talk about that in a second
include
commands on a
Ruthlessly strict need to run basis. So you really need to strip your example down and
Then I say pack it in pack it out and don't take liberties with other people's computers
and this is referring to
Making sure that if you create files you remove them or if you change the working directory
you reset it if you change options you reset them, but basically
Leaving things as you found them
but um, I want to talk about
So, let's see. Here's
Here's what that right page would look like if you want to read it more
But let me just give a short example of something that a lot of people
Struggle with which is that they feel like they have some big hairy data object and they can only show their example using it
So tricks to know
So the read CSV file you probably think of as normally being a function that you use to bring data
Sorry, the read PSD function is something you usually bring delimited data in from a file
But it also has a text argument that allows you to inline
Really tiny R objects and then also just the data playing function itself. So I'm gonna rep
Record short cut
Those two snippets of code and see that's a very easy way to make a very tiny data frame either
inline using an read CSV or
sort of some first principles using data frame and
Then if you are a tiny verse adherent
The Tibble package is what takes care of
The care and feeding of Tibbals which are a flavor of data frame
and the tribal function is extremely useful for
creating tiny little data frames because it allows you to write it in this really
humane
Row-wise way like the same way it would look in for example in a CSV file. So if I reference this little snippet,
You'll see very very similar output as what we just saw with the base function
But it allows you to inline the creation in this case of a two row two column
data frame or you can again use just the table function directly and
So if you make a lot of references you get you get really good at figuring out how to inline the creation of very small
objects, of course figuring out
What's the smallest object that still shows your problem is difficult and we're going to talk about that very end
Okay, another principle is that the rhetoric should contain code? I do not have to run
because a lot of your readers have a great deal of our experience and
Sometimes not always but sometimes they can quickly see the point without actually running the code
but that is greatly enhanced if they can see the output instead of having to
run it in their head and in their
Imagination and trying to figure out what's happening
It's just much easier if you can actually see the output
And so that's why I think it's important that your typical rec recs
Contains the code and it also reveals the output
Being produced by that code
So here's an example. I took from the github repository
Where the read our package is developed because it's a perfect little example and it probably was pretty used with reference
You can't tell
And this person is just reporting a bug but it's like a great minimal example
it says, you know if the header and your CSV contains
quoted new lines you get kind of a weird column name and you get weird data and
The fact that this person provided a small example and it completely shows the problem. I
Imagine is the maintainer Jim Hester who's listening to this fall?
to to quickly label this as a bug and we've already got at least one other user giving it a thumbs up meaning they've
Experienced it as well. And so
If you would only have the code here, I think you'd have a lot less sort of quick engagement with this issue
Okay, so code that I can easily run is very important. We're going to keep working with that issue
so if that person
had instead
Copied and pasted the output from their our console. This is what we would be faced with
so if I were Jim Hester, and I needed to
Reproduce this issue and make sure that it's still a problem
I have a lot of really annoying
Editing to do so I have to get rid of all the prompts at the beginning of the lines
I have to get rid of all this output to
Isolate the three lines of code that actually do anything so copy paste from the our console hits
Some of our checklist but it's not great because it's very hard for the next person to run this code
Worse than copy paste is the screenshot
so
This of course does again hit some of our checklist
It clearly shows the code and the output but again if somebody else wanted to check this and reproduce it
They actually have to retype
Everything which frankly is never gonna happen
and
so this is what I want to see in a reference because it can be copy pasted and run so I'm gonna prove that to
you right now, so if I go to this issue on github and
I copy I could copy all of this or I could as long as I get all the commands. I'm okay
So I'm gonna put that on my clipboard. I'm gonna go
back to our
Maybe to make this really explicit
I'll show you what I copied. All right, that's what I did so I can copy this again and call Rex
And I get exactly what this person was reporting on
Github so I've been able to reproduce it very quickly from a copy paste
But as you saw rep Rex's like are you sure you want to do this? Because I'm I've got this output here and
so if you
If you really want to get really clean code from our rep Rex that someone else has made
you
capture it and use
One of the undo functions and the reference package. I could use a reference clean and I'll show you that right now
So here's what I copied from github so I could copy that
And call repres clean and now if I paste you'll see all the output has been eliminated
And so that's a slightly
Obscure thing you might want to do
but there are the full set of
Some backwards functions and repre so it helps you
Take code that people have copied from the console
or that they have already made a reference from
okay, so we've gotten to essentially the the meet of
The webinar now, so if you were really interested in basic usage, you've seen it now
And now I'm going to go into the shock-and-awe section where I run through a lot of more interesting
Features of the reference package that I still think are pretty cool
So the slides show you what we're about to do live
So I'm going back to our studio and I'm in a script called shock and awe I'm gonna
Restart our just for good measure
so the first thing I want to show you is how
Frictionless repres can make it to talk to people about figures
so I'm gonna load the Gapminder data and
Ggplot2 and I'm gonna make a
Plot with ggplot2, so you see it down here in my plots pane
So let's say that there's something about this
I don't like or that I want to discuss with a colleague I can use reference for this
So as usual I can select the snippet
Copy to my clipboard and run
Rex
You're gonna see all the same stuff
So we've got a nicely rendered rhetorics. It includes the figure
Watch this
I'm gonna go to a github repo that I created just play around with I'm gonna create a new issue. I
Have a question about this plot, and I'm going to paste
Let's look at what we've got. We have the usual sort of nicely formatted
markdown
And look at this
so when when reference rendered this code, it made your figure and
pushed it up to imager and
Dropped this link into your markdown
So if I submit this issue?
People see my code and they see the actual figure that you just made
so this is an example of one of the
Cool things you can do that removes a tremendous amount of friction if you're trying to have a quick conversation with somebody
about code that produces figures
Okay, so we're gonna go back to this shock-and-awe script and we're gonna execute reference many times showing some of the
options and
different arguments you have
So so far. I've only shown you
Referencing when the source code is on the clipboard
but there are a lot of other ways to provide the input so you can
Provide it directly in the reference call as an expression
So here you see that the assignment of X&Y gets done and we compute the correlation between them
There's also an input argument that I'm actually not going to demonstrate
You can provide the source
as a file or as a character vector
Reference by default goes and does its work in the session temp directory?
That's all part of it
Sandboxing all of your work, but if your repre for example file and put an output
It could be much easier to force reference to work in your current working directory
so out file
Equals n/a is shorthand for that. So if I try to if I ask are to write
the first six letters of the alphabet to a file
Without files na
All of a sudden these four files that reference needs to create are being left behind in my working directory
instead of in a temp directory and it's
the r script that reference makes
It's the HTML
Then it uses for the preview and
The markdown that it puts on the clipboard for you. So all those usual files
Are left behind in a much more accessible place
But you'll notice it has a god-awful file name because we just created it out of thin air
So if you want to work somewhere specifically and have nice filenames
You could also provide the base for that in out file
And now you see that it leaves the same for files behind that they have a much better file name
Okay, so so far I've been producing a reference output that's optimized for github
So it's producing what's called github flavored markdown?
But Stack Overflow is another common
Target and that produces slightly different looking markdown
Stack Overflow
doesn't use fenced code blocks that use an indented code box and
Let me show you what this would look like. I'm gonna pretend like I'm gonna answer my own question on stackoverflow
but I won't actually submit this but now if you paste that and to Stack Overflow
It also has a preview feature and it will be formatted correctly for Stack Overflow
You can also make reference produce
It creates an R script which seems sort of weird but an R script that includes the output as comments
And that is very handy for pasting into an email or into slack. So I'm gonna show you the slack
version of that
So this is me talking to myself on slack. I'm gonna create a code snippet
paste
it
Maybe I always have it set to R
create a snippet and
that would create a little R file in slack properly syntax highlighted and again people could copy paste it into R and
run it or
Sometimes you just want to inline it you don't get the syntax highlighting, but that also looks quite nice
The final venue I'll talk about is RTF the rich text format and
This is a very experimental
Venue, it only works
Probably on the Mac at this point because I actually have to call an external utility to do this
But I'd like to show you this and in fact, it's how I need the slides
for this talk, so
you run a little bit of code, but now I can go over to keynote or PowerPoint or something and
I could paste that in and I'm getting rendered our code that is properly
Syntax highlighted and that is in fact how all the snippets in my webinar was produced?
You can
Suppress the inclusion of that little add at the bottom
or you can include it you can ask for your reference to include session info and
for the github
venue, it can be placed in this cute little
Collapsible thing so is a great thing to include if you think for example that the bug you're reporting
Could possibly be related to the version of software on your computer. And I love that it gets folded here. So then
Sometimes people include this one. They don't need to and it's kind of overwhelming
So the fact that we can put it in this folding tag is really nice
Rep ryx can also use the styler package to restyle your code. So here's a
Really? I would say poorly formatted piece of code
so by default rep Rex trusts that you know what you're doing and that you
Like your formatting, but if you don't trust yourself
You can explicitly ask for reference to restyle your code and give it a much more conventional layout
You can be silly and change your comment string and make it some sort of really fun if you want
Rex is part of the tidy verse right? And so the tidy verse meta package can be quite chatty
At start up and tell you all the packages that you just attached and if there are conflicts between them
So we actually have a special argument
Where you can control whether you want that or not and usually you don't so we default to silencing it
And then the last thing I'll show you is
reference can actually capture
Input that in an interactive chef session shows up in your console, but it's actually being sent to standard out further standard error
so I'm going to
Install a package from github that requires
Compilation this takes a moment. So I'm gonna chat over it
But what you're gonna see when this replica actually renders is that we have captured
Everything that would normally show up in the our console
When doing this so the stuff that is sort of coming from our as well as the things that are being sent
standard output and standard input I
Was hoping that you know that there we go. Okay, and so here's
the output of installing the bench package from github which does require
Compilation and so this is the part that's coming through sort of normal our channels and this is capturing
What's being sent to standard output and standard?
input
So that was a very quick live demo of some of the more
I don't know if they're really advanced but features you don't need in every rep racks, but that you might need before long
A lot of the things that I showed you
toggling on and off
You can actually set up your own personal defaults for these things by again putting some code and your dart profile
Which we've already talked about. So this is
Just an example of someone who hates the add they always want to include session info
They always want to restyle their code. They have a whimsical sense of what the comment
string should be for output and they
They always want to see the tiny first startup message
So these are not my defaults but it's an example of what you can do. And the last thing I'll show you mechanically is
Most of the time I do not do what I've shown you which is copying
Code to the keyboard and then going to the console and typing that corrects. There are two our studio add-ins that really
Accelerate your rep Rex life and one of them is called render repres which launches a GUI
I'll show you that in a second or repres selection
literally references the code that you have selected and it's absolutely conceived for use for the keyboard shortcut and
Our studio lets you
Modify your keyboard shortcuts and so I have bound that add-in to shift command R
This is how I usually use Rex and for example hadley also, it uses it a lot. He has bound it to something else
And let me go show you the add-in
So again, I could select the snippet of code that made that figure and
Launch the add-in and so this allows you to specify a lot of the things that you can specify on the call
By clicking so I am going to take the source from the current selection
Let's target stackoverflow and yes, let's append session info click render and
The usual things happen and the usual output appears
down here and stackoverflow doesn't have
The capability to support this little folding toggle. So the session then but actually gets dumped in there and it's full glory
so that is
These are two other ways to
Get your input into the reference function that actually are probably more humane than typing it all the time
All right, the last thing I'll say we have I'll try to go quite quickly he's already at 25 minutes is
Talking a little bit about the human side of making
Reproducible examples and now this has nothing to do with the reference package. It's just about asking questions
So that they actually get answered
And I like this image because it conveys somehow the
You know, we're talking about programming
Maybe we're all supposed to be acting like robots and people often seem to assume that they're talking to robots
But that there's a lot of humans involved in this process and I want to warn you. I'm getting a little bit of tough
Love here. There's there's been a lot of all they're probably still not enough talk of
experts being empathetic to
Newcomers and question askers, but since this is a talk targeted at people asking questions and preparing examples
I also want to say it has to go the other direction as well. So bear with me for a moment here
but I need to say
You know with all the love in the world
Sometimes people come with a question and they have like a very
Rigid theory about what's wrong or how they should be solving a problem
But if your theory about what was going wrong was so great like you you wouldn't be here asking this question right now and
This is the origin of why people really want to see code instead of having sort of a prose discussion
Because it's very hard sometimes to tell what people are really talking about
The other
Like phenomenon I want to link this to is I don't know if you've had this experience
but if you've ever tried to help for example one of your relatives
Sort out a computer problem over the phone. It can be extremely difficult
A lot of what they're saying doesn't really make sense
They don't use the words you're used to to refer to things
You just feel like you can't really get a grip on things
And and this is basically what it feels like when you're trying to answer someone's programming question
just based on English prose and again like this is why people
Constantly push you to actually just show a small piece of code
removes all sorts of ambiguity
so
Let's assume that everybody the question asker and the question answerer is acting in good faith
And if they're not then they're irrelevant to me. Okay, so everyone's in good faith
It turns out that experts posting on public sites. I actually are afraid to
Post code that doesn't work. And so another reason why these people want to see your code is
You know
they're not just reading it and guessing most of these people are actually running your code proving that their proposed solution works and
Then they post it when they know that it's safe to do. So and this was a big like revelation to me
I really used to think that the people I looked up to as experts
just knew all this stuff by heart and they were answering all these questions just off the cuff and
Then it gradually dawned on me that
Part of why they're experts or X behavior is that they are constantly running lots of small examples and experiments
So sharing your problem in code is extremely fruitful
Making a good reference is a lot of work
Like sometimes you think I can only show my problem in my art session and I haven't restarted R for seven months
and it requires the full data set from my thesis and
That isn't fact true. It is a lot of work, but you're asking other people to solve a problem and
So this is part of meeting them halfway
But it turns out you get a lot out of this as well. So let's be very selfish
If you make a good rep Recor hairy messy problem
And if you reproduce other people's problems
Even reproducing other people's problems is a real service and then sometimes you're going to be able to solve them
It turns out this discipline. It's like playing scales or
You know serving over and over again like you actually get better at programming
by doing this and the last selfish point that I'll make is
it turns out when you sit down to make a good reference out of your problem and
You keep it self-contained you strip down your giant hairy data set to the smallest data set that reproduces
The problem it is amazing
How often you end up answering your own question in the privacy of your own home
and you didn't have to make yourself vulnerable to other people so
This is a great revelation. And I think the reason this works, is that when you have a problem
it's very easy to just keep going in circles and banging your head against the desk, but there's something about
Preparing it for other people and the rhetorics package is also being a real hard-ass about making sure that you're a problem is self-contained
It kind of knocks you out of that very unproductive
Place and gets you back on the path of actually working the problem
So most people report this when they first start making reproducible examples is that it's kind of amazing. How often this
Exercise means you actually answer your own question. I
Will skip over this section since we're out of time and I didn't think people wanted to know it but it's here a little bit
About what's happening behind the scenes?
And I will conclude I want to give a huge. Thank you to
you age' and all the people who have brought us the our markdown package and
pan doc the rhetorics package is
Just a wrapper around those things and I mean that in both senses like that is literally all that it is
So in some sense, there's not much there there but on the other hand
When I first made it and then especially now that I've worked on it more
There's actually a lot more going on like the friction that it removes
This isn't is friction. That is really important to remove I think
So in any case, it could not be possible without our Mac done and pan dock
and in fact
I should thank all the co-authors of repres and there's a lot of people who have contributed to it and a lot of users
Who've been extremely generous with their bug reports and feature requests and reporting how things work on different platforms
so to conclude
Go forth and engage in very precise code heavy
conversations about our
I'm going to
Take a look at the questions now
Okay
Okay, so I can see these you cannot what did I leave PowerPoint on?
That's a decent slide. Okay can reference be able to also capture
Variables in the environment and include in the reproducible example currently it cannot and that is very intentional
Because we we really prioritize this sandboxing I
Am actually contemplating basically creating a back door for this
mostly because of
creating RTS
Snippets, but at the moment it cannot and that is intentional
But you know, I'm open to people
sharing their use case about why that should be but basically if you do this
Yeah
There are ways you could do it that actually make those objects available to other people as well
But it becomes a much heavier weight package. So so far we have not done that
Often times this is a continuation of that question. The issue is buried in some part of larger code and
Rather than going back to the places where that data is gathered or calculated. Wouldn't it? Be nice to grab the variable name current state?
Again, like yes, and no I would say
Extracting that out is perhaps part of your job. Oh, I'm not realizing that some of these questions have been answered
Does repres the function actually check that the code is self-contained or does it just generate a template it?
just generates a template so
The way you would find out that your code is not self-contained is that you get an error
But it's explicitly allows errors because sometimes you're using rep X to show errors, so no it is just
It's on you the human to decide if you're getting the result you expect
Does read are read CSV support the text argument as an alternative to file or is that only in rideau?
c sv ried are also does this it also supports the
inline
creation of a data frame
It does it through its primary argument. So you would want to read the help for me
underscore CSV, but in fact, it's actually sort of
even a smaller departure from your usual use I
Think I have another
Instance of the same question which is could reference help you package up an existing data set
And stick it into your data
That reference Deusen don't document
outlines various ways of doing this
for sample
D put is a great function if you have a
slightly awkward object and you simply cannot make your point without using it D put at least creates a
Representation of that that you can put into our reference but so far, you're right. I have not made this terribly easy and
At least the story I tell myself is that
Finding a really simple object and making it
But is intrinsically part of the reference task, but this does come up over and over again
Can you do a reference for a shiny?
It's not easy, I think the shiny team is or has developed their own webpage
talking about how you
Create shiny rep Rex's like and they don't use this package. So now I'm talking about rep Rex's as a concept
10 rep Rex produce interactive plots. All I will say is I have not done so
So I'll end on this question I
Don't know it would have to be tried
But what I will say the side that I skipped over what actually happens so currently reference
Works by dumping your our code into a templated
our script and
I have contemplated
revisiting this and dumping it into a
into an armed markdown file and then
It would be much more
Capable in terms of what you can do like in some ways
There's a lot of equivalence between rendering our scripts and our markdown files
But there are some key differences and so I could imagine that the ability to include
interactivity is probably
present if you're using our markdown and could easily be absent if you're using our
Alright, I think I will leave it
Here and
Clue the webinar
You
No comments:
Post a Comment