Thursday 27 August 2020

String and Class in R

 LEVELS:Displays levels of each variable in the data

TABLE:Display the count of each levels present in the data

EMPLOYEE       PERFORMANCE

RAM                      VG (Very good)

SAMANYU             G  (Good)

JACK                     EXC(Excellence)

JILL                        VG (Very good)

JONE                     EXC (Excellence)

LEVELS:3(EXC,VG,G)

TABLE:EXC=2,VG=2,G=1

str:displays the datatype of each variable in the data

class:dataframe

Example: lp.csv 

Name  Age  Marks 

surya  29     98 

sivi   10      23 

somu  24    99

bapu  26    80

jack  47     89 

jone  34     79

solution: 

data1<-read.csv("lp.csv)

levels(data1$Marks)

table(data1$Marks)

str(data1)

class(data1)

1 comment:

  1. You don't realize how quickly technology is changing. Data science is highly technical and is therefore in high demand. A career in data science will open up many lucrative job opportunities. So, if you have been wanting to start your career in Data Science, now is the best time to enroll in a data science program with one of the best data science training institute in noida.

    ReplyDelete

apply function in R

1) apply function: It takes 3 arguments matrix,margin and function.. Example: m<-matrix(c(1,2,3,4),nrow=2,ncol=2) m #1 indicates it is ap...