There's nothing worse than running a long piece of code then, part way through, it crashes.
You need to rewrite your code and start again.
That is where error handling comes in.
1/11
Oct 20, 2022 • 21 tweets • 7 min read
How to use R with GitHub
...so you can share your projects, version control code and stand out from the crowd with a data portfolio
#rstats#coding#datascience
GitHub is an online platform used for hosting, tracking and collaborating on software projects, built on a free version control system, Git.
GitHub knowledge is a key skill for any data professional.
And a portfolio can make you seriously stand out from the crowd.
1/20
Oct 7, 2022 • 17 tweets • 6 min read
Writing functions in R troubling you?
How and when to write your own functions (including the mysteries of non-standard evaluation and the ellipsis ...)
#rstats#coding#datascience
Functions are blocks of code organised together which perform a specific task.
R comes with many built-in functions which we can add to by downloading fantastic packages.
However, writing your own functions is where the true power of R lies - though it can be confusing.
1/16
Sep 27, 2022 • 19 tweets • 6 min read
A pillar of good coding is good documentation. And it goes beyond just comments.
How to write great documentation for your code in R.
#rstats#coding#datascience
Documenting your code is essential so that others, or future you, can understand what is going on.
Coding is complicated. What is obvious to you may not be obvious to someone else. Good documentation can help them out.
The first thing we will look at are comments.
1/18
Sep 20, 2022 • 21 tweets • 7 min read
You've probably installed a bunch of packages in R.
But did you know they are a fantastic way to organise your own analysis?
A thread on how to write your own package in R.
#rstats#coding#datascience
Packages are collections of code and data, combined together into one tidy bundle.
This makes them great for analysis projects - not just for downloading packages like dplyr or data.table.
Writing a package might sound intimidating but I'll show you how.
1/20
Sep 13, 2022 • 21 tweets • 8 min read
If you want to write robust code, unit testing is a must. A thread on how to write unit tests in R.
#rstats#coding#datascience
A fundamental principle of writing strong code is the DRY principle - don't repeat yourself.
In R, functions allow us to write chunks of code that can be used again and again.
But how do you know your function is working correctly?
This is where unit testing comes in.
1/20
Sep 7, 2022 • 10 tweets • 5 min read
How to use R with DuckDB (so you can turbo charge your data queries and handle big data effortlessly)
#rstats#spark#datascience
Big data is any data which is too large to be loaded into memory all in one go. Ever tried to read a large dataset into R and everything fell over or slowed waaaaaay down? This is where Spark comes in.