Your peers in the course Data Analysis in R at the TU München create and share summaries, flashcards, study plans and other learning materials with the intelligent StudySmarter learning app.

Get started now!

Data Analysis in R

Creating a sequnce with replicate function

rep() replicates a vector a certain number of times and concatenates them

rep(c(TRUE, FALSE), times = 5)

—–> TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE

rep(c(TRUE, FALSE), times = 5)

—–> TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE

Data Analysis in R

Numerics: Create a sequence

seq(from = 1, to 10, by = .3)

Data Analysis in R

replicatinge each entry of the input vector at the time

rep(c(TRUE,FALSE), each = 5)

——> TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE

——> TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE

Data Analysis in R

Names - Properties

names don´t have to be unique, but should preferably be, as subsetting by names will only return the first match

x<- c(a = 1, a = 2, b = 3) x["a"] not all elements need to have names c(a = 1,2,3) ##a ##1 2 3

x<- c(a = 1, a = 2, b = 3) x["a"] not all elements need to have names c(a = 1,2,3) ##a ##1 2 3

Data Analysis in R

Setting names - two alternatives

x <- c(a = 1, b = 2, c = 3)
x OR names(x) <- c("A","B", "c")
x

Data Analysis in R

Numerics: Create a sequnce with 20 values

seq(from = 1, to 10, length.out = 20)

Data Analysis in R

Which parameter allows to ignore missing values?

mean(v, na.rm = TRUE)

Data Analysis in R

Working with missing values

missing values are specified with NA

Placeholders for the specific type and such are something like an unspecified value

if not taken care of, it can break computation

Placeholders for the specific type and such are something like an unspecified value

if not taken care of, it can break computation

v <- c(1,3,5,NA)

Data Analysis in R

Modify the third entry

x[3] <- 'z'

Data Analysis in R

Accessint the thrid entry in a vector

x[3]

Data Analysis in R

Creating an A,b,c,d,e vector

x <- LETTERS[1:5]

Data Analysis in R

How are atomic vectors usually created?

with c() (from concatenation)

For your degree program Computer Science at the TU München there are already many courses on StudySmarter, waiting for you to join them. Get access to flashcards, summaries, and much more.

Back to TU München overview pageStudySmarter is an intelligent learning tool for students. With StudySmarter you can easily and efficiently create flashcards, summaries, mind maps, study plans and more. Create your own flashcards e.g. for Data Analysis in R at the TU München or access thousands of learning materials created by your fellow students. Whether at your own university or at other universities. Hundreds of thousands of students use StudySmarter to efficiently prepare for their exams. Available on the Web, Android & iOS. It’s completely free.

Best EdTech Startup in Europe

1## Learning Plan

2## Flashcards

3## Summaries

4## Teamwork

5## Feedback