O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The fread() function is similar to read.table and reads data from the .csv file in a fast and efficient way.

The mongo function creates a mongo connection with a database and a collection name. Then we use the insert function on that connection object to load data into the collection.

The count() function is used to count the total number of documents (that is, the number of rows inserted) in the collection. The iterate()one() function returns the first documents in the collection.

The find() function automatically simplifies the collection into a data frame. The empty query {} attribute means select all data. The fields attribute is used to filter specific columns from the output.

The mongo_create function creates a mongo ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required