Sunday 21 June 2015

R : Data Frames

Data frames are used to store tabular data. Unlike matrices, data frames can store any kind of data in each column.

> table1 = data.frame(id=1:4, firstName=c("Hari Krishna","Joel","Rama Krishna","Sudheer"))
> table1
  id    firstName
1  1 Hari Krishna
2  2         Joel
3  3 Rama Krishna
4  4      Sudheer
> 
> nrow(table1)
[1] 4
> 
> ncol(table1)
[1] 2



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment