Wednesday, 26 August 2020

How to import file in Data science with R?

 Syntax:

object name<-read.csv("filename")

where object name can vary that means you can provide any name...

<- OR =(Assignment operator)

read(): It is  a function  which is used to import   the file in R..

suppose you have csv file then write     read.csv(" filename")

filename can be any name........

Example:

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

where lp.csv   is my file name

Que:How to run  R programming??????

Ans: ctrl+enter

Que:How to display the data

ans:View(data1)

where data1 is my  object name

More Examples are:

1)head(data1)

2)data2<-head(data1,100) #It will display top 100 observation(obs)

3)tail(data1)

4)data2<-tail(data1,50) #It will display bottom 50 observation(obs)

5)nrow(data1)

6)ncol(data1)

7)dim(data1)

Note:

# is used for comment line..

comment line is used for highlighting the text and it will not run the program

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

Global Infrastructure and its components in AWS

You may operate your workloads wherever and however you choose with the AWS Global Infrastructure, and you'll use the same network, cont...