To create data frame in R langauge, you can use data.frame() function.
The following method shows how you can do it with syntax.
Method: Use data.frame() Function
data.frame(column_name = c(value1,value2,...))
Here c represents column.
The following examples shows how to create data frame in R.
Create Data Frame Using data.frame() Function in R
Here we see example to create data frame which having machine data:
# Create data frame
df <- data.frame(Machine_name = c("Machine1","Machine2","Machine3","Machine4","Machine5",
"Machine6"),Value = c(110,120,135,95,98,92))
# Print data frame
print(df)
Output :
Machine_name Value
1 Machine1 110
2 Machine2 120
3 Machine3 135
4 Machine4 95
5 Machine5 98
6 Machine6 92
As in the above example code we created data frame and showed using print() function.