Page 240 - Data Science class 11
P. 240

stringsAsFactors = FALSE

             )# Getting the structure of the data frame.

             str(emp.data)
        On execution of the above code, the following result is shown:























        6.11.4 summary of Data in Data Frame
        The statistical summary and nature of the data can be obtained by applying the summary() function.
        Example

        Enter the following code snippet:

             # Creating the data frame.
             emp.data <- data.frame(
                emp_id = c (1:5),
                emp_name = c("Robert","Dharam","Mini","Sharan","Garima"),
                salary = c(20000.5,35000.2,60000.0,70000.0,84253.25),
                start_date = as.Date(c("2011-01-21", "2013-11-03", "2014-01-25", "2014-07-21",
                   "2015-05-17")),
                stringsAsFactors = FALSE
             )
             # Printing the summary.
             print(summary(emp.data))
        On execution of the above code, the following result is shown:
























          238   Touchpad Data Science-XI
   235   236   237   238   239   240   241   242   243   244   245