Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
RStudio for R Statistical Computing Cookbook

You're reading from   RStudio for R Statistical Computing Cookbook Over 50 practical and useful recipes to help you perform data analysis with R by unleashing every native RStudio feature

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher
ISBN-13 9781784391034
Length 246 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Andrea Cirillo Andrea Cirillo
Author Profile Icon Andrea Cirillo
Andrea Cirillo
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

RStudio for R Statistical Computing Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Acquiring Data for Your Project FREE CHAPTER 2. Preparing for Analysis – Data Cleansing and Manipulation 3. Basic Visualization Techniques 4. Advanced and Interactive Visualization 5. Power Programming with R 6. Domain-specific Applications 7. Developing Static Reports 8. Dynamic Reporting and Web Application Development Index

Evaluating your code performance using the profvis package


The profvis package is a powerful tool for line profiling in R.

This package is provided by the RStudio team, and its most appreciated feature is the interactive report that is automatically produced, representing a really effective way of visualizing and investigating time resources requested by each part of your code.

Getting ready

Since the lineprof package is not hosted on CRAN, but on GitHub, we first need it to install the devtools package in order to leverage the install_github function provided by this package.

Moreover, we will use the ggmap package to build the example to be profiled:

install.packages(c("devtools","ggmap"))
library(devtools)
install_github("rstudio/profvis")
library(profvis)
library(ggmap)

How to do it...

  1. Define a profvis object containing the code to be profiled. Run the following piece of code, initializing the report object.

  2. The following code is used from the drawing a route on a map with ggmap recipe in Chapter...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images