![]() And it turns out that it’s very convenient for hosting my own RStudio Server and anything else I’d like to host, and very affordable even for my student self. She told me that she doesn’t have a solution for me, but that I should check out DigitalOcean, so I did. I only found out about DO a couple of months ago when I asked my supervisor, Jenny Bryan, if there was a way for me to do some R-ing when I’m away from my machine. Check out my DO droplet to see it in action! Use my referral link to get $10 in credits, which is enough to give you a private server for your first 2 months. For example, take a look at my Shiny Server to see how useful this can be.ĭigitalOcean provides virtual private servers (they call each server a droplet), which means that you can pay $5/month to have your own server “in the cloud” that you can access from anywhere and host anything on. If you’ve always wanted to have an RStudio Server of your own so that you can access R from anywhere, or your own Shiny Server to host your awesome shiny apps or Rmarkdown documents, DigitalOcean (DO) can help you get there easily. If you want to learn other concepts of Machine Learning with R, be sure to check out the book Mastering Machine Learning with R – Third Edition.If you want help setting up your Shiny Server, a 1-on-1 walk-through or tutorial, or just general consultation about using Shiny Server, I’m available for hire. I hope you’ve enjoyed it and can implement the methods in here, as well as other methods you learn over time. We created one user-defined function for our package, but your only limit is your imagination. In this tutorial, we went through the process of creating an R package, which can help you and your team put your code into production. There you have it, a useless package, but think of what you can do by packaging your own or your favorite functions, and anyone who inherits your code will thank you. Now you can search for your package, and it should appear:Ĭlick on it and go through the documentation: Do this by clicking Build – Clean and Rebuild. Now comes the moment of truth to build your package. You probably want to rename your function now from hello.R to something relevant. You will now go to Build – Configure Build Tools and you should end up here:Ĭlick the checkmark for Generate documentation with Roxygen. Doing so will create this popup, which you can close and hit OK. Here is the function for our purposes, which just turns all NAs to zero: Export: Here, write the function you desire.Examples: Provide any examples of how to use the function.Param: The parameters for that function the arguments.Now, open up the hello.R function in the R folder, and delete all of it. This is where you would load other packages, such as tidyverse or caret. Here is my version, which will be a function to code all missing values in a dataframe to zero: But first, click on Description and fill it out accordingly, and save it. That is where we will put the R functions for our package. Go to your Files tab in RStudio and you should see several files populated like this: You will now name your package – I’ve innovatively called this one package – and select Create Project: ![]() Select a new directory as desired, and specify R Package, as shown in the following screenshot:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |