R Code Flashcards

1
Q

Remove an observation based on a criteria

A

data[data$variable != criteria, ]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create a Correlation matrix

A

df %>% select_if(is.numeric) %>% cor()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Split data into testing/training set

A

train_ind

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

To create a cp table

A

model_name$cptable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Print coefficients after regularization

A

model_name$beta

How well did you know this?
1
Not at all
2
3
4
5
Perfectly