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...

Step 1 shows how to load the stock price data of both Google and Amazon.

Step 2 shows how to convert the date column into proper R date format using the as.date() function.

Step 3 shows how to visualize the stock price of both these organizations for the last 10 years (from 2007 to 2017). We can notice from the graph that Google has higher closing stock price from mid-2007 to early 2016 compared to Amazon, but from mid-2016, both these organizations have almost similar stock prices till now.

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