Psych10A quiz 2

dim(dat): can help you find rows and columns (R,C)

Dat [1:5, ] gives us…

2:5 will mean grab data point 2,3,4,5

Boolean indexing

  • Truth values

  • True and false

  • Booles

  • No quotes

Dim () will return a vector

tapply(score,group,mean)
Anything in quotation marks is a string(perhaps a vector of strings)

Wide data means that each subject (or observation) has one row, and different variables or measurements are stored in separate columns.

Long data (also called tidy data) is a data format where each row represents one observation of a single variable for a given subject or case.

Correlation can be positive,negative or zero (between -1 to 1)

To round data to the second place

  • round(cor(Dat),2)

R = 1 means fully correlated
R = 0 means unrelated
R = −1 means fully negatively correlated
dat [1,0] means grab all row one

do we use quotes in boolean indexing? answer:no