Here are some commonly asked questions.
This might be because you have an unstable internet connection. Either try again when there are less people using the internet connection, use a different connection, or contact one of the maintainers for alternative offline options.
install.packages("curl")
]Restart your R session by clicking “Session” from the top menu and choosing “Restart R”, or by using the keyboard shortcut CTRL+SHIFT+F10 and try installation again. This is sometimes necessary when updating or installing new packages.
If you continue to encounter errors you may need to install the list of required packages one-by-one,
using the command install.packages()
, as below for the package dplyr (note the name of the package is in quotes):
install.packages("dplyr")
You will need to restart your R session. You can do this by clicking on “Session” in the menu up top and then choosing “Restart R”. Alternatively, you can use a keyboard shortcut: CTRL+SHIFT+F10
If this does not work, try restarting your computer and opening R-Studio again.
If this they still do not appear, then please take a look at this GitHub post.
If you click tools > global options… Then under the general tab you can see the R version. If you click on change… then the different versions will pop up. MRAN will be in a microsoft folder whereas CRAN will be in an R folder. See this picture for an example.
See the R Basics Resources page for a list of introductory online courses.
You can use paste()
to combine the columns and lubridate::ymd_hm()
to convert them into a datetime. For example, here’s how you would combine the columns date_of_x
and time_of_y
(this assumes that the dates are formatted like yyyy-mm-dd and the times are formatted like hh:mm) in the data frame my_data
library(dplyr)
library(lubridate)
my_data %>%
mutate(date_time = ymd_hm(paste(date_of_x, time_of_y), tz = "UTC")
This may be because you need to specify na.rm = TRUE
, which indicates that missing values should be discarded before calculation:
sum(c(1:10, NA))
## [1] NA
sum(c(1:10, NA), na.rm = TRUE)
## [1] 55
You can add include = FALSE
in the chunk header:
```{r, echo = FALSE, include = FALSE, warnings = FALSE, messages = FALSE}
# summary code here
```
Turn on code diagnostics, it will show up with helpful messages https://support.rstudio.com/hc/en-us/articles/205753617-Code-Diagnostics
Take a look at this table from the UCLA statistics department https://stats.idre.ucla.edu/other/mult-pkg/whatstat/
Take a look at this book https://serialmentor.com/dataviz/
LSHTM epidemiology in crises material: http://conflict.lshtm.ac.uk/page_02.htm WHO nutritional survey standards: https://www.who.int/nutrition/publications/anthropometry-data-quality-report/en/