R/R_Usage [Eng.]

Meaning of "header =" in R and colnames default setting

Cha-Nyong 2022. 11. 3. 20:00
Hello,
 
When we input dataframe from R, header = TRUE & hearder = FALSE is frequently used.
 
The meaning is below. 

 

header = TRUE

Row] Fill in the data with first row as variables.

 

header = FALSE

행] Fill in the data without first row as variables, and first raw will be data.

 

 

It's pretty simply, right?

 

After use the "header = FALSE", we can fill in variable names by default.

 

colnames(dataset) <- c("variable1","variable2","variable3","variable4","variable5")

# From first column and row, variable names from 1 to 5 will be filled in.

 

End with insignificant kwowledge.