Skip to content

Instantly share code, notes, and snippets.

@rmflight
Last active January 15, 2020 15:01
Show Gist options
  • Save rmflight/9b41e0548209aa30b637e98f23d7849d to your computer and use it in GitHub Desktop.
Save rmflight/9b41e0548209aa30b637e98f23d7849d to your computer and use it in GitHub Desktop.
Common messages and errors in R, and what they mean

Notice!

This gist is no longer going to be updated. Instead, check out the page at https://rmflight.github.io/rerrors/, or the GitHub project itself at https://rmflight.github.io/rerrors/

Installing packages

You don't need to do 'install.packages("tidyverse")' every time. Install is installing it on your system. You only need to do it again if you re-install R, or want a newer version. 'library()' loads it for use, and 'install.packages()' installs it to your computer.

Error in instal.packages("tidyverse") : could not find function "instal.packages

This error is telling you it can't find the function. Most times, this is because it is spelled wrong, as it is here. Other times, it's because you haven't done "library('tidyverse')" yet and it can't find the function you want. This is a good reason to use a tab-completion enabled editor such as RStudio, it will help you make sure the spelling of functions is correct.

Loading packages

Conflict Messages

library("tidyverse") -- Conflicts ------------------------------------------ tidyverse_conflicts() -- x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag()

This is telling you that there are packages you have loaded via 'library("tidyverse")' that have functions that are named the same as functions in the base install that are always loaded.

Built Version Warnings

Warning messages: 1: package ‘tidyverse’ was built under R version 3.5.3

And this is just saying that the packages on CRAN are built under the latest version of R 3.5.3 , but you have 3.5.something_else. In my experience, as long as it installs, you are OK.

@Maschette
Copy link

Function not found

Error in ggplot() : could not find function "ggplot"

This is telling you that you have not loaded the library that the ggplot function is in (ggplot2 in this case). To fix this you load ggplot2 first with library(ggplot2) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment