Not an R tutorial |
|
| HOME |
So you want to learn R? Well, there's lots of resources for
learning R on the internet. But perhaps too much, so unless you
have a
specific question or a specific error message
you can
enter into the search engine, you can spend a lot of time
searching for needles in haystacks.
I've just been using Google to find basic information about key concepts in R, and found it difficult to find good sources. Many of the pages go into unnecessary detail, assume a background in programming in other languages, or use abstruse examples. So some recommendations seem to be in order. In general, I found YouTube videos to more appropriate for R beginners than most web pages. The videos from DataCamp are particularly impressive, being conceptually clear and professional. Maybe I should just recommend folks sign up for DataCamp , but I haven't looked at their actual courses. The following are just some of the best links I came across during a few hours with Google. Let me know if you have your own suggestions: stats[dot]bcss[at]gmail[dot]com. A bit of everythingQuick-R Data types - a quick overview of vectors, matrices, data frames, lists, and factors. VectorsDataCamp VDO How to create and name vectors in R DataCamp VDO Subsetting your Vectors in R The Academician VDO Special values NA Inf NaN NULL Data Mentor R Vector MatricesDataCamp VDO Learn How to Create and Name Matrices in R DataCamp VDO Learn How to Subset Matrices in R Data Mentor R matrix FactorsDataCamp VDO Using Factors in R Data framesDataCamp VDO Using the Data Frame in R DataCamp VDO Introduction and read.csv DataCamp VDO Learn How to Subset, Extend & Sort Data Frames in R Statistics with R: Selecting a subset of variables from a dataframe using subset() ListsEd Boone VDO Introduction to lists DataCamp VDO How to create and name lists in R LoopsRichard Webster For Loops in R (includes nested loops)
Specific questions or error messagesIf you have a specific question or an error message you don't understand, enter (or copy paste) into your search engine and look for results from stackoverflow or R-bloggers . or the official R help forum at nabble.com. When you're trying to learn R, the sheer volume of available resources can feel overwhelming. A good starting point is to focus on small, concrete tasks rather than trying to absorb the language as a whole. Searching for short explanations of specific concepts often turns up more useful material than lengthy tutorials that try to cover everything at once. Video walkthroughs can be helpful for visual learners, especially when they walk through a real dataset step by step. Above all, learning by doing tends to stick better than reading documentation passively, so working alongside any guide tends to yield the best results. Beyond the basics, R becomes especially valuable through its contributed packages, many of which are aimed at particular kinds of analysis. For anyone working with wildlife or ecological data, there are extensions that handle occupancy models, spatial capture-recapture, distance sampling, and similar specialised techniques. These packages typically come with their own documentation and example datasets that double as tutorials. Installing them is usually straightforward, and once loaded they expose functions that hide much of the underlying statistical machinery, letting users concentrate on the questions they are trying to answer rather than on the mathematics themselves. Many wildlife studies involve estimating things that cannot be counted directly, such as animal density or the probability that a species occupies a site. Capture-recapture methods address this by combining repeated observations with statistical models that account for imperfect detection. When the same idea is approached from a Bayesian perspective, prior knowledge can be folded into the analysis alongside the data, producing posterior distributions that summarise what is plausible given everything available. Markov chain Monte Carlo methods make these computations practical, and tools like JAGS and similar samplers allow researchers to fit quite elaborate models without writing low-level code by hand. Camera traps have transformed how field data are collected, generating large image sets that need to be processed and analysed systematically. R can help with several stages of that pipeline, from reading timestamps and extracting covariates such as time of day, to fitting models of detection probability and activity patterns. Overlap between species at a site, daily rhythms, and responses to environmental gradients can all be explored within the same environment. Linking these analyses with simple spatial layers and habitat covariates further enriches what can be learned from a typical deployment. Working through an example that mirrors a real ecological question is often more instructive than tackling abstract programming exercises. Trying to estimate animal density from a small simulated dataset, or modelling occupancy of a site from detection histories, forces the learner to think about what each function actually does and what assumptions lie behind the output. Inspecting fitted models, plotting results, and checking residuals all build familiarity with the workflow. With time, what begins as a struggle with syntax turns into a comfortable habit of asking data the right kinds of questions. |
| Updated 6 Aug 2018 by Mike Meredith | |