New to Programming and R- Need tips

Hello! I am new to learning R and I could use some help with getting started. If anyone has any roadmap, resources or any personal tips that helped them during their initial days trying to learn a new programming language is very very welcome. My main focus would be data analysis and data science

A useful model for using R is school algebra—f(x) = y where

(x) is what at hand
(y) is what is desired
f() is what will turn the one into the other

Each of these is an object in R and each may be, and usually is, composite (think f(g(x)).

A simple example

# a set of numbers

x <- c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, 24.4, 22.8, 19.2, 17.8, 16.4, 17.3, 15.2, 10.4, 10.4, 14.7, 32.4, 30.4, 33.9, 21.5, 15.5, 15.2, 13.3, 19.2, 27.3, 26, 30.4, 15.8, 19.7, 15, 21.4)

# y the mean, as a measure of central tendency,
# a single number

(y <- mean(x))
#> [1] 20.09062

# same, except only to one decimal place

(y <- round(mean(x),1))
#> [1] 20.1

Created on 2023-04-29 with reprex v2.0.2

Take a look at R for Data Science

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.