FlashKeepers

Data Science · College · College and University

R Programming Fundamentals

R vectors, data frames, factors, apply family, tidyverse verbs with dplyr and ggplot2 grammar of graphics.

About this set

40 basic cards for College Data Science. It opens with "What does c() do in R?" and "How do you get the length of a vector?". Study it alongside the other College sets below.

40 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What does c() do in R?
Show answerCombines values into a vector
How do you get the length of a vector?
Show answerUse length()
What does rep(3, 5) create?
Show answerA vector with 3 repeated 5 times
What does seq(1, 10, by=2) create?
Show answerA sequence from 1 to 10 incrementing by 2
How do you access the third element of vector x?
Show answerx[3]
What are the four main vector types in R?
Show answernumeric, character, logical, complex
What does as.numeric('42') do?
Show answerConverts the string to the number 42
What is the purpose of is.numeric()?
Show answerTests whether an object is numeric, returning TRUE or FALSE
How do you create a data frame in R?
Show answerUse data.frame() function
What does nrow(df) return?
Show answerThe number of rows in data frame df
What does ncol(df) return?
Show answerThe number of columns in data frame df
How do you access the column named 'age' from df?
Show answerdf$age or df[['age']]
What does head(df) show by default?
Show answerThe first 6 rows of df
What does tail(df, 10) show?
Show answerThe last 10 rows of df
How do you add a new column to df?
Show answerdf$newcol <- values or df[['newcol']] <- values

25 more cards in the app

Study this set free