Discover and read the best of Twitter Threads about #cran

Most recents (8)

¿Eres usuario o usuaria de #R y trabajas con datos del @INE_Chile o de otros servicios públicos? En este hilo te enseñamos cómo usar el paquete #calidad, desarrollado por profesionales de nuestra institución y que ya está en #CRAN. Para instalar el paquete tienes dos opciones: Image
...Dentro del #paquete encontrarás algunos #datasets, los que estarán disponibles una vez que el paquete #calidad esté cargado en el ambiente con el siguiente comando: Image
...¡Vayamos ahora con un ejemplo! Si queremos calcular el porcentaje de #pobreza, según sexo y región, debemos crear una variable #dummy con el siguiente código: Image
Read 6 tweets
(1/n) Last year, I led workshops on package development with the help of @RLadiesVan and @RLadiesSeattle. I often find it helpful learning why a tool is useful before diving into how to use it, so I began each workshop by motivating why you might want to try creating a package:
@RLadiesVan @RLadiesSeattle (2/n) I’ll write a few lines of code to accomplish a specific task. Later, I'll often find that the code chunk is rather applicable to other situations. I might copy and paste the relevant lines of code and repurpose it by changing a few characters here and there.
@RLadiesVan @RLadiesSeattle (3/n) If I find myself having to do this multiple times (>2), it's a sign for me to wrap the code into a function. If I ever need to change its behavior, I'll just have to edit the function definition. This sure beats trying to find and amend all instances of the copied code!
Read 7 tweets
Now that you know how a general package structure looks like, we can start building a package 👩🏼‍💻
#RStudio is great, just follow these steps: Select "File", "New Project...", "New Directory" and select "R Package". You can now give your R package a meaningful name, select a path and hit "Create project". Showing RStudio wizard when creating a new package
You're now ready to go! Once executed, you have a fully functional package structure in your #Rproject (that we already discussed) 😊 Now it's time to move your function to your "R/" folder and populate it! Showing how the RStudio desktop version looks like with a ty
Read 8 tweets
The beauty of R is its versatility and of course the community 💜 you can use R (and different #CRAN packages) for literally anything (I use #shiny to build web applications, #blogdown to set up and maintain my website, #xaringan to create slide decks, ….).
All these great tools build upon one “little” (or not so little) thing: functions!

💡 What are functions?
A function is an inherent code block that performs a specific task, such as calculating a sum. And that's exactly what we are doing now 😊
👩🏼‍💻 How to write them?

In #rstats, functions can be as simple as this: Code showing how a simple function is set up name_of_the_fun
Read 8 tweets
Hello everyone 👋 my name is Cosima and I usually tweet at @cosima_meyer.
In my professional life, I work as a data scientist in the field of AI. I love my job because it allows me to work with fantastic teams to solve puzzles👩🏼‍💻 Image showing two people holding two puzzle pieces to the sk
@cosima_meyer Before working in the industry, I explored my passion for research in academia. I hold a PhD from the University of Mannheim in #politicalscience (my dissertation dealt with post-civil war stability 🕊).
@cosima_meyer While working at @MZESUniMannheim, I co-founded a #datascience blog “Methods Bites” (@mzes_ssdl) which provides several hands-on tutorials on #NLP, scraping #Twitter data, #dataviz, or how to publish your package on #CRAN.
Read 11 tweets
CRAN Task Views relaunched with many improvements! #rstats #cran @_r_foundation

CRAN.R-project.org/web/views/

CRAN Task Views provide a means to find and install pkgs that are relevant for a certain task (e.g., "MachineLearning", "Optimization", "Econometrics", etc.).

Thread (1/7): Screenshot of the task views overiew web page on CRAN: https
Each task view page provides:

- Overview of how to use it.

- Information on #rstats pkgs for the topic.

- List of CRAN pkgs that can be installed.

- Links to other resources and pkgs on other repositories etc.

Example: Econometrics task view.

CRAN.R-project.org/view=Econometr… Screenshots of the econometrics task view web page on CRAN: Screenshots of the econometrics task view web page on CRAN: Screenshots of the econometrics task view web page on CRAN:
Pkgs can be installed with pkg #ctv:

ctv::install.packages("Econometrics", coreOnly = TRUE)

installs all the econometrics core packages or

ctv::update.packages("Econometrics")

installs all packages that are not yet installed and up-to-date.

(3/7)

CRAN.R-project.org/package=ctv
Read 8 tweets
Hey #rstats! I'm excited to announce that my first package, the #ggplot extension ggh4x is now available on #CRAN 📢! cran.r-project.org/web/packages/g…. Thanks to everyone putting package development tutorials out there and the ggplot2 team for the extension mechanisms! 🧵
The package is mostly a collection of convenience functions I've accumulated over time, so it might be a bit chaotic. Hopefully it can be convenient to you too! Examples below:
Get rid of duplicated strip labels in multi-layered facets with `facet_nested()`:
Change the absolute or relative sizes of panels to your liking
Read 13 tweets
🚨🎉New preprint (and R package #rstats) out in @F1000Research, with @AdamJKucharski and @sbfnk : We developed the package o2geosocial to reconstruct who-infected-whom from routinely collected surveillance data. f1000research.com/articles/10-31 (NOT YET PEER REVIEWED) 1/5
The objective of o2geosocial is to make the most of epidemiological data when genetic sequences are not available, nor informative. It uses the date of symptoms onset, location, age and genotype of the cases to reconstruct who-infected-whom #CRAN CRAN.R-project.org/package=o2geos… 2/5
This preprint describes the implementation of o2geosocial. It also shows how to group cases into transmission clusters and infer who-infected-whom using o2geosocial and simulated data. We implemented different models to highlight the flexibility of the method. 3/5
Read 5 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!