{"id":2814643,"url":"https://github.com/rmflight/rerrors","last_synced_at":"2026-01-29T17:17:08.849Z","repository":{"id":49903083,"uuid":"233972229","full_name":"rmflight/rerrors","owner":"rmflight","description":"collection of errors in R as well as explanations","archived":false,"fork":false,"pushed_at":"2021-06-08T14:10:47.000Z","size":77,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-19T03:33:02.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmflight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-15T01:35:16.000Z","updated_at":"2024-02-03T16:58:31.000Z","dependencies_parsed_at":"2022-08-29T13:42:05.918Z","dependency_job_id":null,"html_url":"https://github.com/rmflight/rerrors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2Frerrors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2Frerrors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2Frerrors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmflight%2Frerrors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmflight","download_url":"https://codeload.github.com/rmflight/rerrors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228994850,"owners_count":18003460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-29T18:54:21.322Z","updated_at":"2026-01-29T17:17:08.841Z","avatar_url":"https://github.com/rmflight.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"## Collection of Errors, Warnings and Messages in R\n\nWhen someone is first starting out in R, if they are not used to programming, the various errors, warnings and messages that R provides can be intimidating. This is meant to be a useful collection of observed types of messages that R provides, along with an explanation of what R is trying to tell them.\n\n### Have an Error Message?\n\nIf you have an error message you need help with file an [issue](https://github.com/rmflight/rerrors/issues).\n\nIf you have an error message and explanation you want to add, [please clone the repo](https://github.com/rmflight/rerrors), add your message, and create a pull request.\n\n## Installing packages\n\nYou 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.\n\n```\ninstal.packages(\"tidyverse\")\nError in instal.packages(\"tidyverse\") :\n could not find function \"instal.packages\n```\n\n\nThis 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. \n\n## Loading packages\n\n### Conflict Messages\n\n```r\nlibrary(\"tidyverse\")\n-- Conflicts ------------------------------------------ tidyverse_conflicts() --\nx dplyr::filter() masks stats::filter()\nx dplyr::lag()    masks stats::lag()\n```\n\nThis 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.\n\n### Built Version Warnings\n\n```\nWarning messages:\n 1: package ‘tidyverse’ was built under R version 3.5.3\n```\n\nAnd 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. \n\n### Dependency Version Error\n\n```\nlibrary(ggplot2)\n\"package or namespace load failed for ‘ggplot2’ in loadnamespace(i, c(lib.loc, .libpaths()), versioncheck = vi[[i]]): namespace ‘ellipsis’ 0.3.1 is being loaded, but \u003e= 0.3.2 is required\"\n```\n\nHere, you've recently upgraded `ggplot2`, and now you are seeing an error about the `ellipsis` package.\nIt means that the `ellipsis` package is out of date.\nThe easiest way to verify what is going on, is to look directly at it, and double check the version you have installed, in this case by doing:\n\n```\npackageVersion(\"ellipsis\")\n[1] '0.3.1'\n```\n\nThis shows that indeed, the wrong version of `ellipsis` is currently installed.\nSo you should restart R (Ctrl+Shift+F10 from RStudio), and then install the affected package and check it again:\n\n```\ninstall.packages(\"ellipsis\")\npackageVersion(\"ellipsis\")\n```\n\nHopefully it provides the right version.\nIf it doesn't, you may need to check the [version currently available on CRAN](https://cran.r-project.org/web/packages/ellipsis/index.html).\nNormally, a package isn't available on CRAN if it's dependencies also aren't available, but sometimes R doesn't do a good job of updating the dependent packages.\n\n## Using packages\n\n### Function not found\n\n```r\nggplot(...)\nError in ggplot() : could not find function \"ggplot\"\n```\n\nThis 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)` .\n\n### Lengths differ\n\n```r\nx = rnorm(100)\ny = rnorm(1000)\nplot(x,y)\nError in xy.coords(x, y, xlabel, ylabel, log) : \n 'x' and 'y' lengths differ\n```\n\nThis is pretty clear, the number of x coordinates is different to the number of y coordinates you have given. Often caused by either a typo in x or y names, or you subsetted one and not the other. You can double check it by doing:\n\n```r\nlength(x)\nlength(y)\n```\n\n### Length is not a multiple\n\n```r\n(1:2)*(1:3)\n[1] 1 4 3\nWarning message:\nIn (1:2) * (1:3) :\n longer object length is not a multiple of shorter object length\n```\n\nThis is only a warning, but you should usually think of it as an error.  Your code is trying to do an operation on two vectors of different lengths.  R has rules that allow the operation to proceed (which is why it's only a warning) but you probably used the wrong name or subsetted one and not the other, or something similar.\n\n###  Not subsettable\n\n```r\ndf[2]\nError in df[2] : object of type 'closure' is not subsettable\n```\n\nTechnically, R is telling you that you are trying to subset a function (`df` is the density function for the F distribution).  In practice, this almost always happens when you think you have a variable called `df` (eg, a data frame) but R can't find it. Most likely the variable doesn't exist, but it might exist somewhere that R can't see. \n\n### Unexpected String Constant\n\n```r\ndata_frame[, c(\"column1\" \"column2\")]\nError: unexpected string constant in data_frame[, c(\"column1\" \"column2\")]\n```\n\nWhat happened here when I tried to get two columns of the `data_frame` is that I forgot the \",\" in between the two column names.\n\n## File Permissions\n\n### Zip Permission Denied\n\n```r\nzip(zipfile, ...)\nsh: 1: : Permission denied\nWarning message:\nIn system2(zip, args, input = input) : error in running command\n```\n\nAs of R 4.0.3, this means that R can't find the zip command on a Unix or Linux type system.\nThe way to fix it is to do:\n\n```r\nSys.setenv(R_ZIPCMD = \"path/to/zip\")\n```\n\n## Contributing\n\nIf you have an error message you need help with file an [issue](https://github.com/rmflight/rerrors/issues). \nIf you have an error message and explanation you want to add, [please clone the repo](https://github.com/rmflight/rerrors), add your message, and create a pull request.\n\nThis project has a [Contributor Code of Conduct](https://github.com/rmflight/rerrors/blob/master/CODE_OF_CONDUCT.md), and you are asked to abide by it.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmflight%2Frerrors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmflight%2Frerrors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmflight%2Frerrors/lists"}