Clearing the workspace you just can’t shake

When you exit RStudio, you’ll see a pop-up asking, “Save workspace image to ~/.RData?” If you’re unsure, you’ll probably select Save. After all, it is the default. Plus, saving is good. Right?

Quit R session pop-up. Image by author.

Well…it depends. The next time you load RStudio, everything in your workspace (global environment) will be exactly how you left it. If it took a really long time to load your data into R, then this is fantastic. You don’t have to go through that cumbersome process again! Phew!

But what if, instead, you had a bunch of useless crap you’d prefer never to see again? You might…

Giving your networks a user-friendly makeover

Photo by Christin Hume on Unsplash

When it comes to network analysis, igraph is a beast of a package with extensive documentation. If you do network analysis in R, chances are you’ve at least heard of it. With igraph, you can create and compare deterministic or stochastic networks, calculate centrality measures, and find communities within a network. You can even implement graph algorithms on a network with millions of nodes and edges!

Even when it comes to visualization, igraph has an abundance of options. First, there’s the basic functionality you’d expect for plotting: changing the size, shape, labels, and layout of the network. But you can…

Photo by Daniel on Unsplash.

From gene regulatory networks to agricultural pest control, there are numerous applications of Bayesian networks in biology. If you’re a biologist, or even a computer scientist, this list will help you begin your journey towards understanding Bayesian networks and their use in biology.

1. Probabilistic Methods for Bioinformatics with an Introduction to Bayesian Networks by Richard E. Neapolitan

Who will be the winneR?

A new package called ‘backbone’ recently dropped on CRAN and I’m super stoked about it. Essentially, the package simplifies a co-occurrence matrix by extracting its ‘backbone.’ The package offers various methods for extracting a backbone, one of which involves the use of the hypergeometric distribution to assess whether the co-occurrence is significantly less than or greater than expected. Since the ‘cooccur’ package does the same thing, I thought, “Hmmm…Which one’s faster?” And that, my dear friends, is how this battle of the CRAN packages began. Without further ado, let’s start this PACKAGE RACE!!!

Preparing the track

For convenience, we’ll use the finches data…

With calculations in R

In ecology, co-occurrence networks can help us identify relationships between species using repeated measurements of the species’ presence or absence. When evaluating potential relationships, we might ask: Given presence-absence data, are two species co-occurring at a frequency higher or lower than expected by chance? Somewhat surprisingly, although co-occurrence analysis has been around since the ’70s, there’s no universally agreed upon method for measuring co-occurrence and testing its statistical significance (Veech, 2012). In this post, we’re going to examine the probabilistic model as seen in Veech’s A probabilistic model for analysing species co‐occurrence(2012). We’ll start by defining the model before moving…

Using the R packages ‘cooccur’ and ‘visNetwork’

Co-occurrence networks are a graphical representation of how frequently variables appear together. They’re commonly used in ecology and text mining, where co-occurrence measures how frequently two species are seen together within a sampling site or how frequently two words are present in a single document, respectively. A co-occurrence network allows us to examine several pairs of co-occurring variables simultaneously. To construct a co-occurrence network, each variable is represented by a node, or point. An edge, or link, connecting two nodes represents the co-occurrence between those two variables.

Here, we’ll look at how to construct co-occurrence networks in R using the…

Being mathematically gifted isn’t a strict prerequisite for being a data scientist. Sure, it helps, but being a data scientist is more than just being good at math and statistics. Being a data scientist means knowing how to solve problems and communicate them in an effective and concise manner. It’s a collection of nuanced skills and, chances are, most data scientists need additional assistance in at least one of these skills. So if math is the skill you’re lacking, don’t give up hope!

Focus on the concepts

Thanks to technology, we have computers that do most of the mathematical heavy lifting for us. Phew…

Graphs created with ‘visNetwork’ in R

Graphs are an excellent way to gain a deeper understanding of large systems of information as they provide us with a flexible and intuitive way to generate insight through visualizing the relationships within the data. In this tutorial, we’ll focus specifically on undirected graphs. Both Facebook and LinkedIn connections can be illustrated with undirected graphs because a connection between two people always goes in both directions. Such is the case of the reciprocal nature of these websites (friendships must be mutual, invitations must be accepted, etc.), and unlike platforms such as Twitter where you can follow someone but they don’t…

Brooke Bradley

Hi! I’m Brooke Bradley and I study data science in the biomedical field. Visit for more!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store