r programming with mongodb

40
R Programming R Programming with MongoDB with MongoDB Prepare by Prepare by Prof. B.A.Khivsara Prof. B.A.Khivsara Assistant Professor, Assistant Professor, Department of Computer Engineering, Department of Computer Engineering, SNJB’s K.B. Jain COE,Chandwad SNJB’s K.B. Jain COE,Chandwad

Upload: bhavana-khivsara

Post on 11-Apr-2017

124 views

Category:

Education


0 download

TRANSCRIPT

Page 1: R programming with mongoDB

R Programming R Programming with MongoDBwith MongoDB

Prepare byPrepare byProf. B.A.KhivsaraProf. B.A.Khivsara

Assistant Professor, Assistant Professor, Department of Computer Engineering,Department of Computer Engineering,

SNJB’s K.B. Jain COE,ChandwadSNJB’s K.B. Jain COE,Chandwad

Page 2: R programming with mongoDB

Outline

Page 3: R programming with mongoDB

Outline

Page 4: R programming with mongoDB

R

Page 5: R programming with mongoDB

Installation of R

Page 6: R programming with mongoDB

Installation of R….

Click on Save File OptionClick on Save File Option

Page 7: R programming with mongoDB

Installation of R….

Page 8: R programming with mongoDB

Installation of R….

Page 9: R programming with mongoDB

Installation of R….

Page 10: R programming with mongoDB

Installation of R….

Page 11: R programming with mongoDB

Installation of R….

Page 12: R programming with mongoDB

Installation of R….

Page 13: R programming with mongoDB

Installation of R….

Page 14: R programming with mongoDB

Installation of R….

Page 15: R programming with mongoDB

Installation of R….

Page 16: R programming with mongoDB

Installation of R….

Page 17: R programming with mongoDB

Installation of R….

Page 18: R programming with mongoDB

R….First look

Page 19: R programming with mongoDB

R….First Command

Page 20: R programming with mongoDB

Outline

Page 21: R programming with mongoDB

Installation of R studio

Page 22: R programming with mongoDB

Installation of R studio….

Page 23: R programming with mongoDB

Installation of R studio…• Following page will be displayed click on suitable option that you

want to download(Here I downloaded Rstudio Desktop-Opensource)

Page 24: R programming with mongoDB

Installation of R studio…..

Page 25: R programming with mongoDB

Installation of R studio…..

Click on Save File OptionClick on Save File Option

Page 26: R programming with mongoDB

Installation of R studio…..

Page 27: R programming with mongoDB

R studio has Installed successfully

Page 28: R programming with mongoDB

Open R studio folder and click on bin folder

Page 29: R programming with mongoDB

Find rstudio in bin folder and click on it.

Page 30: R programming with mongoDB
Page 31: R programming with mongoDB
Page 32: R programming with mongoDB

• Ctr+L to clear console screen

Page 33: R programming with mongoDB
Page 34: R programming with mongoDB

Outline

Page 35: R programming with mongoDB

Installation of Mongo

Page 36: R programming with mongoDB

Outline

Page 37: R programming with mongoDB

RMongo & rjava Packages in RStudio

• Open Rstudio and on console write• >install.packages(“Rmongo”)• If error comes for Internet Connection then

– Set no proxy setting– Default browser set Internet Explorer

• In Rstudio Menu ->Tool ->Global Options -> Packages -> Uncheck use Inrenet explorer library/proxy for HTTP and try again to install.packages(“Rmongo”)

Page 38: R programming with mongoDB

RMongo & rjava Packages in RStudio

• In rignt side bottom window in Rstudio • Package tab• Check rjava and Rmongo• If error comes then need to install java

version from official website which will be compatible with R version you are using.

• If no error comes then write following command on console

• >help(package=Rmongo)

Page 39: R programming with mongoDB

Outline

Page 40: R programming with mongoDB

First RMongo Script/Programlibrary(RMongo)mg1<-mongoDbConnect('db1')dbShowCollections(mg1)dbInsertDocument(mg1,"stud",'{rno:1,name:"Amit"}')res<-dbGetQuery(mg1,'stud',"{ }")print(res)

•Note: Before running script make sure that Mongo Server is started.