You are on page 1of 1

Data Frames

Syntax to create dataframes

df<- data.frame(---------)

where df is the variable of type dataframe

data.frame --> is a keyword used to create dataframe for multiple data

Create a data frame to create 5 employee records.

empdf<-
data.frame(empid=c(1:5),empname=c("a","b","c","d","e"),salary=c(28000,25500,25200,2
6000,30000),
DOB= as.Date(c('02-01-1989','1978-02-25','1989-02-26','1990-05-06','1965-06-20')))
print(empdf)

You might also like