-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small improvements in the austen_books function? #13
Comments
Thanks for the kinds words! 🙌
Can you say a little more about what you mean here? |
Your package currently has 7 functions with one for each book and one, called austen_books which you day in the documentation "Returns a tidy data frame of Jane Austen's 6 completed, published novels with two columns:" You give the code in the Examples section. Here it is:
I am requesting a trivial change, because the code doesn't run as provided. Could you please change it to either:
or to:
I know this is a totally trivial request to any R whizz, but my audiance includes many who find R scripts to be tricky stuff and I'd like example scripts for them that work first time! I would be even happier if you added a second function to your package, perhaps called austen_books4 that produces an even tidier script. This uses the code from your book, which adds chapters and line numbers in each book, so it gives 4 variables. If you would like to go a small step further, perhaps also include a 5th variable giving line numbers per chapter, as well as per book? A bit more background on our work and why I am spending time on something so minor. We work in Reading, UK, together with a team in Kenya nand Ghana. Our audience includes many from Africa, but I think the audiance is worldwide. It seeks to add many more people who become users of R, but they currently find it difficult. So we draw a distinction between "Using R scripts" and "Writing R scripts". We claim that learning how to use R scripts - and even to "tweak" them - is pretty easy. So it is well within the capabilities of potential users, who just want to analyse their data and would prefer to delay or omit learning how to write a script. So, currently your code is fine, but a user needs to "tweak" it to get it to run. I'd prefer it as an example that doesn't even need tweaking! Thanks Roger |
Ah, for the code in "Examples" sections, it is not typical/normal/good practice to include loading the package itself. Notice that the package is not loaded in these examples in dplyr and ggplot2:
In the janeaustenr examples, I can do If I were to add the additional helper function you suggest, I'd need to add stringr as a dependency to janeaustenr. I'd rather not do that since it is meant to be a very lightweight, mostly-just-data package, but let me ponder it for a bit. Thanks again for the kind words! 👍 |
Humpf, I hadn't expected this to be at all contraversial. You write "it is not typical/normal/good practice to include loading the package itself". We are really keen on tidyverse, so if it is not good practice then I would like to explain that point, and then it is really easy for the user to add, so it isn't a big deal really. But I disagree that it isn't typical. With our interest in Africa I particularly use agricolae and I really like the examples in the agridat package. Both have the library with each script. Of course a lot in "typical" depends on the unit - agridat has over 300 data, each with scripts, so I would like that to count for much more than the few scripts in the moderndive package. That agrees with you! If you do stick to your principles, then I would still be really happy if you could add the second function - from your book, or adapted from the code in your book - to produce even tidier data! It shows really neat R for this important tidying process. For the users we work with, we find the tidying step is often the most difficult - and can be a bit demoralising, because the user has still not started on their analyses. So we are encouraging people to be able to use pre-written code, for the tidying, rather than having to write it. And these are great examples. |
@juliasilge I really like the janeaustenr package, so many thanks.
I am using it as an example to show that starting with a little "neat" R is often useful. I have 2 small suggestions:
a) The current version includes the
library(dplyr)
line, but there is nolibrary(janeaustenr)
line. Please could this be added.b) Your book includes an even "tidier" version with four variables. Very nice. Could you include this function instead - or maybe as well? It is easy to copy from the book, but even easier if it could be included in the package.
Happy New Year
Roger
The text was updated successfully, but these errors were encountered: