<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8187876860689246411</id><updated>2011-12-06T14:05:42.524-06:00</updated><title type='text'>The power of R</title><subtitle type='html'>This is a blog dedicated to motivate communication between users or the R-project to share ideas, problems to solve or the general use of this amazing tool.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-6064327584967690589</id><published>2009-10-07T14:04:00.003-05:00</published><updated>2009-10-07T22:05:02.751-05:00</updated><title type='text'>What 'The power of R' is saying</title><content type='html'>&lt;div style="text-align: justify;"&gt;Hey again,&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I was looking for random things at google and I found such an interesting site: &lt;a href="http://www.wordle.net"&gt;www.wordle.net&lt;/a&gt;, were you can put lots of words or the url of a blog (like this for example) and you get a cloud with the words you put and you can change colors and everything, here's what I got with the blog... &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SszoSLiFioI/AAAAAAAAAIQ/pNokKl9nkyQ/s400/word+cloud.jpg" /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Enjoy it :)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-6064327584967690589?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/6064327584967690589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/10/what-power-of-r-is-saying.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/6064327584967690589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/6064327584967690589'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/10/what-power-of-r-is-saying.html' title='What &apos;The power of R&apos; is saying'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NDm0inJ4HF4/SszoSLiFioI/AAAAAAAAAIQ/pNokKl9nkyQ/s72-c/word+cloud.jpg' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-5230614314046636730</id><published>2009-09-06T19:53:00.018-05:00</published><updated>2009-09-08T14:42:14.072-05:00</updated><title type='text'>Comparison between 15 different cities...</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_NDm0inJ4HF4/SqVp1sNd2QI/AAAAAAAAAFo/d25EtH2eUec/s1600-h/expediture+vs+salary.png"&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;The other day I was thinking about how expensive will it be to live in London (as I'm going to live in London for almost one year), and also thinking about how expensive are the cities where some of my best friends live and I got a &lt;a href="http://www.ubs.com/1/e/wealthmanagement/wealth_management_research/prices_earnings.html"&gt;report by UBS&lt;/a&gt; called "Prices and Earnings 2009", it's all about life costs and salaries in 100 cities around the world, so I started 'playing' with some of the data from 15 cities in that report and I decided to use R, I used some regressions and bar plots, but I thought it would be interesting to use real examples to make it even more interesting, if anybody needs the code to generate the graphics I posted here just let me know ok?, here is what I got...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Total expenditure in goods and services vs Salary per hour&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;In this first graph, we can think about the salary as a function of the total expenditure in goods and services, the salary tends to increase when the expenditure in goods and services increases, i.e. the more you spend in goods and services in your city, the more you have to earn. An easy way to think about this graphic is that the 'fair' salary for each point in the x axis (expenditure) should be the red line (a linear regression using these points), then, the cities above the red line are the ones who earn more money than the money they should, then the goods and services there are cheaper than they should be; by the other side, the ones below the red line, earn less money than the money they should given what they spend in goods and services in that city, an important thing to say is that &lt;b&gt;the size of the bubbles in the graphics is the GDP for each city&lt;/b&gt;. Then, for example, Mexico city (my city) is expensive, but by the other side, London would be 'fair' talking about the expenditure in goods and services. Any comment about the other cities?&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://3.bp.blogspot.com/_NDm0inJ4HF4/SqVp1sNd2QI/AAAAAAAAAFo/d25EtH2eUec/s400/expediture+vs+salary.png" /&gt;&lt;/div&gt;&lt;div&gt;To enlarge the graphic click &lt;a href="http://picasaweb.google.com/lh/photo/5eQi_tJq26i1JV4QdR0RoA?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: rgb(85, 26, 139); -webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;How much will I spend in food in London?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;After getting the last graphic, I was wondering how much would I spend in food in London, so I did the same with the data available, it was the cost of a weighted basket of goods with 39 foodstuffs, to be more accurate: the monthly expenditure of average Western family, here is what I got:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SqSIeWBoBwI/AAAAAAAAAFg/WuOM4zJDwvo/s400/Food+vs+Salary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378573909877065474" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 246px; " /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;To enlarge the image click &lt;a href="http://picasaweb.google.com/lh/photo/vK1ZegSDsAXozbXNJ6nhUA?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;It's almost the same than last graphic, but here we have the Net hourly pay in USD per hour as a function of food prices, which, according to a linear regression, the salary should increase as prices in food do so, and again, the bubbles on the line would be the cities with 'fair' food prices according to their salary, here for example, Mexico city it's expensive when we think about food given the net hourly income we have here, but for example, London or Berlin would be cheap, because they earn more than they should given food prices in those cities; while Stockholm has 'fair' prices when we think about food, what do you think about the others?...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;What about apartment rents?&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;After thinking about food and expenditure in goods and services, I also wanted to think about apartment rents, the data I got was the average cost of housing (excluding extremes) per month, which an apartment seeker would expect to pay on the free market at the time of the survey. The figures given are merely tentative values for average rent prices (monthly gross rents) for a majority of local households. Here's the interesting graphic that I got:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NDm0inJ4HF4/SqRzDMqn-CI/AAAAAAAAAEo/zu7LcjxpRj4/s1600-h/AptRents+vs+Salary.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;img src="http://2.bp.blogspot.com/_NDm0inJ4HF4/SqRzDMqn-CI/AAAAAAAAAEo/zu7LcjxpRj4/s400/AptRents+vs+Salary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378550353764022306" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 246px; " /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To enlarge the image please click &lt;a href="http://picasaweb.google.com/lh/photo/HrcroBWP15_buFHt3Zr1Jw?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Here we (again) can think about the salary as a function of apartment rents, then, the ones above the line are the 'cheap' ones (given their net hourly pay per hour), the ones below are the 'expensive' ones, and the ones on the red line are the ones who with a 'fair' price. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;Mexico city seems to be expensive, while London seems to have 'fair' prices, any comment about New York? &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;What about going out for dinner?&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I think this is such an important topic, wether if you're going out for dinner with friends or if you're going out with a special person... I think it's important to know what cities are expensive to go out for dinner at, don't you think?, the data I used here refers to the price of an evening meal (three-course menu with starter, main course and dessert, without drinks) including service, in a good restaurant, here is the graphic:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_NDm0inJ4HF4/SqR3VOsoMgI/AAAAAAAAAEw/6vfZ5JjXI_o/s400/RestPrices+vs+Salary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378555061593453058" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 246px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To enlarge the image click &lt;a href="http://picasaweb.google.com/lh/photo/aGB7PnedPA9S98aSI9NjLQ?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Here it's the same idea than in the last 3 graphics, we can think about the salary as a function of restaurant prices, and again (of course), we can see that when restaurant prices increase, we should expect the net hourly pay to increase as well. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;We can see that going out for dinner in cities like Mexico City, London or Buenos Aires is expensive, but, by the other side, someone who lives in New York, Montreal, Berlin or Toronto, would find it cheaper given how much they earn per hour in their cities. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Public Transport, how much for a single ride?...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;I also found some info about public transport, but I decided to focus on Bus, Tram and Metro, What I did is a bar plot to compare prices in the 15 different cities I chose, here's what I got:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://3.bp.blogspot.com/_NDm0inJ4HF4/SqR_-wF9fpI/AAAAAAAAAFA/yKGbZR2sCIo/s400/Public+transport.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378564571025735314" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 238px; height: 400px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To make the image bigger please click &lt;a href="http://picasaweb.google.com/lh/photo/q4qZwfY3Fq7ZHvhfWSUtJg?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;At least talking about public transport, Mexico City is the cheapest, but what about London or Stockholm?...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;An interesting graphic I found...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;After analyzing the previous graphics, I started thinking about some other things to analyze, the first one was the relationship between the working hours per year and the net hourly pay in each city, and I found something really interesting:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://1.bp.blogspot.com/_NDm0inJ4HF4/SqR5daOdxgI/AAAAAAAAAE4/Sdk2ygdv6lg/s400/WH+vs+Salary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378557401150375426" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 246px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To enlarge the graphic please click &lt;a href="http://picasaweb.google.com/lh/photo/BBaj8MIXwZIqzDNvameYLA?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Isn't it amazing?!!!, What this graphic says is that the less we earn per hour, the more we work!, I was surprised by this, here we have the salary as a function of the working hours per year, and the ones below the red line are the cities that work more than what they earn, and the ones above the red line are the ones that work less than what they earn, all kind of comments accepted...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have you ever thought about the working time required to buy something?....&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Well, I found data about the working time required to buy an Ipod and a Big Mac, pretty sad in some cases, here are the graphics...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;img src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SqSCZeUgxEI/AAAAAAAAAFI/5S_P3XViqqs/s400/Ipod.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378567229134652482" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 298px; height: 400px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;To make the graphic bigger please click &lt;a href="http://picasaweb.google.com/lh/photo/Tu-xcxP6g3VW5gFPavz6ew?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We can see how different and hard it is to get an Ipod nano in places like Warsaw, Bogotá, Mexico City or Buenos Aires,  but what about London, Los Angeles or New York?, isn't it frustrating?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;By the other side, I got the same graphic for a Big Mac:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/_NDm0inJ4HF4/SqSDVph4HUI/AAAAAAAAAFQ/QRy6rt_AKgI/s400/BigMac.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5378568262935649602" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 391px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;To make the image bigger click &lt;a href="http://picasaweb.google.com/lh/photo/G2cL7R41tXr4Z96LUDHYbQ?authkey=Gv1sRgCKznoI7z-fm1vQE&amp;amp;feat=directlink"&gt;HERE&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ok, this one is pretty sad, I don't know what you think about it, but what it comes to my mind just by looking at this one is inequality, any comments?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks for reading me again, and as I said before, If any of you needs the code to generate this graphics just let me know ok? Have a great day :)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-5230614314046636730?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/5230614314046636730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/09/comparison-between-15-different-cities.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/5230614314046636730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/5230614314046636730'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/09/comparison-between-15-different-cities.html' title='Comparison between 15 different cities...'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_NDm0inJ4HF4/SqVp1sNd2QI/AAAAAAAAAFo/d25EtH2eUec/s72-c/expediture+vs+salary.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-4810768217595666861</id><published>2009-08-20T22:03:00.006-05:00</published><updated>2009-08-20T22:51:10.718-05:00</updated><title type='text'>No success yet, then more animations...</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NDm0inJ4HF4/So4VwOwtpqI/AAAAAAAAADw/LHayxtrOFTw/s1600-h/bootstrap.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 319px;" src="http://2.bp.blogspot.com/_NDm0inJ4HF4/So4VwOwtpqI/AAAAAAAAADw/LHayxtrOFTw/s320/bootstrap.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5372255323839899298" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;So I've been here dealing with the installation of a software that Yihui Xie suggested me to change the format of the animations displayed in R, she told me that all I needed to do&lt;span class="Apple-style-span" style="font-family: Georgia, serif; "&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt; was to go to &lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 16px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;a href="http://imagemagick.org/" target="_blank" style="line-height: 1.2em; text-decoration: none; color: rgb(0, 51, 153); outline-style: none; outline-width: initial; outline-color: initial; "&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;http://imagemagick.org&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: normal;  "&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;to download ImageMagick for&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; my operating s&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;ystem and install it, but all I got was lots and lots of files and I hav&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;en't found the one to start the installation, so I decided to post the last 4 animations I was thinking &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;to post in here with the code to create them in case you want &lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;to try them by yourselves.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;The &lt;b&gt;first animation&lt;/b&gt;  I'm going to start with is called "Bootstrapping the i.i.d data", This is a naive version of bootstrapping but may be useful for novices. As you can see in the first im&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;age, in the top plot, the circles denote the original dataset, while the red sunflowers (probably) with leaves denote the points being resampled; the number of leaves just means how many times these points are resampled, as bootstrap s&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-family:georgia;"&gt;amples with replacement. The bottom plot shows the distribution of x bar star.  The whole process has illustrat&lt;/span&gt;ed the steps of resampling, computing the statistic and plotting its distribution based on bootstrapping.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The code to generate such animation is:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.options(ani.height = 500, ani.width = 600, outdir = getwd(),&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    title = "Bootstrapping the i.i.d data",&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    description = "This is a naive version of bootstrapping but&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    may be useful for novices.")&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.start()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;par(mar = c(2.5, 4, 0.5, 0.5))&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;boot.iid(main = c("", ""), heights = c(1, 2))&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.stop()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;For the &lt;b&gt;second example&lt;/b&gt; I chose an animation called "The concept of confidence intervals". This animation shows the concept of the confidence interval which depends on the observations: if the samples change, the interval changes too. At last we can see that thecoverage rate will be approximate to the confidence level.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://3.bp.blogspot.com/_NDm0inJ4HF4/So4W51uz3NI/AAAAAAAAAD4/hkS4DOpxcVo/s320/conf+intervals.png" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;If you want to generate this animation, the code is the next:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.options(ani.height = 400, ani.width = 600, outdir = getwd(), nmax = 100,&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    interval = 0.15, title = "Demonstration of Confidence Intervals",&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    description = "This animation shows the concept of the confidence&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    interval which depends on the observations: if the samples change,&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    the interval changes too. At last we can see that the coverage rate&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    will be approximate to the confidence level.")&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.start()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;par(mar = c(3, 3, 1, 0.5), mgp = c(1.5, 0.5, 0), tcl = -0.3)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;conf.int()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.stop()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The &lt;b&gt;third animation&lt;/b&gt; I chose was one I thought would be pretty useful, it's called "The Newton-Raphson Method for Root-finding". I think this animation doesn't need further explanation, it goes along with the tangent lines and iterates, and you can also change the function that the example gives you to try as default, pretty interesting one.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://2.bp.blogspot.com/_NDm0inJ4HF4/So4YfZ3sZHI/AAAAAAAAAEA/D5uOjidW6do/s320/newton+raphson.png" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So the code is:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;oopt = ani.options(ani.height = 500, ani.width = 600, outdir = getwd(), nmax = 100,&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    interval = 1, title = "Demonstration of the Newton-Raphson Method",&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    description = "Go along with the tangent lines and iterate.")&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.start()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;par(mar = c(3, 3, 1, 1.5), mgp = c(1.5, 0.5, 0), pch = 19)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;newton.method(function(x) 5 * x^3 - 7 * x^2 - 40 *&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    x + 100, 7.15, c(-6.2, 7.1), main = "")&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.stop()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.options(oopt)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The &lt;b&gt;last example&lt;/b&gt; I thought would be pretty interesting for the ones who had just started learning probability, it's called "Simulation of flipping coins". This animation has provided a simulation of flipping coins, which might be helpful in understanding the concept of probability. This is such a colorful and simple animation, pretty interesting, enjoy it.&lt;img src="http://2.bp.blogspot.com/_NDm0inJ4HF4/So4Y_oBn_sI/AAAAAAAAAEI/ZaLZiMpahN4/s320/coins.png" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;If you want to generate it, just type:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;oopt = ani.options(ani.height = 500, ani.width = 600, outdir = getwd(), interval = 0.2,&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    nmax = 50, title = "Probability in flipping coins",&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    description = "This animation has provided a simulation of flipping coins,&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    which might be helpful in understanding the concept of probability.")&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.start()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;par(mar = c(2, 3, 2, 1.5), mgp = c(1.5, 0.5, 0))&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;flip.coin(faces = c("Head", "Stand", "Tail"), type = "n",&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;    prob = c(0.45, 0.1, 0.45), col =c(1, 2, 4))&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.stop()&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;i&gt;ani.options(oopt)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-4810768217595666861?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/4810768217595666861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/08/no-success-yet-then-more-animations.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/4810768217595666861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/4810768217595666861'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/08/no-success-yet-then-more-animations.html' title='No success yet, then more animations...'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_NDm0inJ4HF4/So4VwOwtpqI/AAAAAAAAADw/LHayxtrOFTw/s72-c/bootstrap.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-3413999638082031109</id><published>2009-08-19T17:36:00.008-05:00</published><updated>2009-08-19T17:58:26.463-05:00</updated><title type='text'>2 Interesting animations...</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NDm0inJ4HF4/SoyCGWfcyeI/AAAAAAAAADg/87eK23cL9bg/s1600-h/grad.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 216px;" src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SoyCGWfcyeI/AAAAAAAAADg/87eK23cL9bg/s320/grad.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5371811501174475234" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;So I haven't had success YET in finding a way to post here the animations, but I thought it would be interesting to show you at least a couple of examples using this software, and I chose 2 pretty interesting ones by Yihui Xie and Xiaoyue Cheng.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The first one is "The Gradient Descent Algorithm", it follows the gradient to the optimum. The arrows will take you to the optimum step by step. By the end of the animation, you get something like the image above.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The code to generate such animation is:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;library(animation)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;# gradient descent works&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;o&lt;span class="Apple-style-span" style="font-style: normal; "&gt;&lt;span class="Apple-style-span" style="font-style: italic; "&gt;opt = ani.options(ani.height = 500, ani.width = 500, outdir = getwd(), interval = 0.3,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    nmax = 50, title = "Demonstration of the Gradient Descent Algorithm",&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    description = "The arrows will take you to the optimum step by step.")&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.start()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;grad.desc()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.stop()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.options(oopt)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;For the second example I chose an animation called "The k-Nearest Neighbour  Algorithm",where, for each row of the test set, the  nearest (in Euclidean distance) training set vectors  are found, and the classification is decided by majority vote, with ties broken at random.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;By the end of the animation, you will get something like this:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SoyCTJ6hJcI/AAAAAAAAADo/eC-iNBOgbto/s320/K-N.png" /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The code to generate such animation is:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;library(animation)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;oopt = ani.options(ani.height = 500, ani.width = 600, outdir = getwd(), nmax = 10,&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    interval = 2, title = "Demonstration for kNN Classification",&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    description = "For each row of the test set, the k nearest (in Euclidean&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    distance) training set vectors are found, and the classification is&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    decided by majority vote, with ties broken at random.")&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.start()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;par(mar = c(3, 3, 1, 0.5), mgp = c(1.5, 0.5, 0))&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;knn.ani()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.stop()&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.options(oopt)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;I'll keep trying to find the way to upload the whole animations and not just the final result these days, wish me luck!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: right;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-3413999638082031109?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/3413999638082031109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/08/2-interesting-animations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/3413999638082031109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/3413999638082031109'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/08/2-interesting-animations.html' title='2 Interesting animations...'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NDm0inJ4HF4/SoyCGWfcyeI/AAAAAAAAADg/87eK23cL9bg/s72-c/grad.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-4469877862133667397</id><published>2009-08-18T17:15:00.008-05:00</published><updated>2009-08-18T18:19:28.875-05:00</updated><title type='text'>Have you ever heard about the 'animation package'?</title><content type='html'>&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Well, I had never heard about it, but this morning I was looking for some information about another package and I found and article about this interesting package at 'The R-Journal'  (&lt;/span&gt;&lt;span class="Apple-style-span"  style=" white-space: pre; font-family:'Segoe UI';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;http://journal.r-project.org/)&lt;/span&gt;&lt;span class="Apple-style-span"  style=" white-space: normal;  font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, it was on the Vol. 8/2, October 2008, by Yihui Xie and Xiaoyue Cheng, and it says something like..&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" white-space: normal;  font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" white-space: pre; font-family:'Segoe UI';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style=" white-space: normal;  font-family:Georgia, serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"The animation package (Xie, 2008) uses graphical and&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;other animations to communicate the results of statistical&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;simulations, giving meaning to abstract statistical theory."&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Awesome!, isn't it?.  The basic idea of an animation, consists of multiple image frames, which can be designed to correspond to the successive steps of an algorithm or of a data analysis.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The basic schema for all animation functions in the package is:&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.fun &lt;- function(args.for.stat.method,args.for.graphics, ...) {&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{stat.calculation.for.preparation.here}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;i = 1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;while (i &lt;= ani.options("nmax") &amp;amp;other.conditions.for.stat.method) {&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{stat.calculation.for.animation}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{plot.results.in.ith.step}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;# pause for a while in this step&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Sys.sleep(ani.options("interval"))&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;i = i + 1&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;# (i - 1) frames produced in the loop&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ani.options("nmax") = i - 1&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{return.something}&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I will leave this post here while I find the way to upload the animations in here, hope not to delay too much in that.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Have a nice day ;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-4469877862133667397?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/4469877862133667397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/08/have-you-ever-heard-about-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/4469877862133667397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/4469877862133667397'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/08/have-you-ever-heard-about-animation.html' title='Have you ever heard about the &apos;animation package&apos;?'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-228092978758431533</id><published>2009-08-18T02:10:00.009-05:00</published><updated>2009-08-19T15:34:58.517-05:00</updated><title type='text'>The density function</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_NDm0inJ4HF4/Sopfnxe2lcI/AAAAAAAAACw/gmp1oX0FeTE/s1600-h/density+UKgas.jpg"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 320px; FLOAT: left; HEIGHT: 170px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5371210642495018434" border="0" alt="" src="http://2.bp.blogspot.com/_NDm0inJ4HF4/Sopfnxe2lcI/AAAAAAAAACw/gmp1oX0FeTE/s320/density+UKgas.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Today I found such an interesting function called "density", this function computes kernel density estimates, that's why I found it pretty interesting, all you need is:&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;the the data from which the estimate is to be computed &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;the smoothing kernel to be used (This must be one of &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"gaussian"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"rectangular"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"triangular"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"epanechnikov"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"biweight"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"cosine"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; or &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"optcosine"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, with default &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;"gaussian"&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;, and may be abbreviated to a unique prefix -single letter.)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;For example, I used some of the datasets included in R to use this function with different&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; kernels, my first example was using the data set called 'UKgas', which contains the Quarterly UK gas consumption from 1960Q1 to 1986Q4, in millions of therms. The 1st image shows the histogram of given data set using a gaussian kernel, while the second image shows the same but using a rectangular kernel, where the diference between both estimations is obvious.&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;For the 2nd example I used a dataset called 'Treering', which contains normalized tree-ring&lt;span class="Apple-style-span"  style="font-size:small;"&gt; widths in dimensionless units, here the 2nd image uses a gaussian kernel, and the image on the left uses a rectangular kernel, where the&lt;img src="http://2.bp.blogspot.com/_NDm0inJ4HF4/Sopf9a-sKGI/AAAAAAAAAC4/UYBW-RrBbI0/s320/density+treering.jpg" /&gt; difference between both estimations again is obvious.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Now, from the statistical point of view, if we type on R &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:monospace, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;density(treering), &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;we will get the next:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="COLOR: rgb(0,0,238); -webkit-text-decorations-in-effect: underline" class="Apple-style-span"&gt;&lt;img style="TEXT-ALIGN: center; MARGIN: 0px auto 10px; WIDTH: 320px; DISPLAY: block; HEIGHT: 146px; CURSOR: pointer" id="BLOGGER_PHOTO_ID_5371204956702409602" border="0" alt="" src="http://4.bp.blogspot.com/_NDm0inJ4HF4/Sopac0QQg4I/AAAAAAAAACo/1QnTJTaAPVw/s320/results+density.jpg" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Which shows the basic statistics for the density estimation, another reason why I found this function pretty interesting and useful.&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;To finish with this post, I will add the code used for the examples, have a great day! :)&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;par(mfrow=c(1,2))&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;hist(treering,prob=1,breaks=20)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;lines(density(treering,kernel="gaussian"),col=2)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;hist(treering,prob=1,breaks=20)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;lines(density(treering,kernel="rectangular"),col=2)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;density(treering)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;par(mfrow=c(1,2))&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;hist(UKgas,prob=1,breaks=20)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;lines(density(UKgas,kernel="gaussian"),col=2)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;hist(UKgas,prob=1,breaks=20)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;lines(density(UKgas,kernel="rectangular"),col=2)&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-228092978758431533?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/228092978758431533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/08/here-we-have-example-of-density.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/228092978758431533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/228092978758431533'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/08/here-we-have-example-of-density.html' title='The density function'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_NDm0inJ4HF4/Sopfnxe2lcI/AAAAAAAAACw/gmp1oX0FeTE/s72-c/density+UKgas.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-2734000179007937836</id><published>2009-08-14T10:54:00.000-05:00</published><updated>2009-08-14T10:58:16.512-05:00</updated><title type='text'>Everybody loves R</title><content type='html'>I found this articles in The New York Times" and I thought it would be nice to share them, By ASHLEE VANCE published on January 6, 2009, check them out, both are pretty interesting:&lt;br /&gt;&lt;br /&gt;http://www.nytimes.com/2009/01/07/technology/business-computing/07program.html?_r=1&lt;br /&gt;&lt;br /&gt;http://bits.blogs.nytimes.com/2009/01/08/r-you-ready-for-r/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-2734000179007937836?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/2734000179007937836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/08/everybody-loves-r.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/2734000179007937836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/2734000179007937836'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/08/everybody-loves-r.html' title='Everybody loves R'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-1444030839488844866</id><published>2009-07-28T10:39:00.000-05:00</published><updated>2009-07-30T11:02:28.524-05:00</updated><title type='text'>I know it's been so long...</title><content type='html'>Hey,&lt;br /&gt;&lt;br /&gt;I know it's been so long since last time I posted something in here, but I was really busy with my thesis and some other stuff, but now that I have more time I promise I'll post some interesting stuff in here, by the way, I found such an Interesting site talking about R being used by Facebook and Google, it's by Michael E. Driscoll, here it is in case you want to check it:&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://dataspora.com/blog/predictive-analytics-using-r/"&gt;http://dataspora.com/blog/predictive-analytics-using-r/&lt;/a&gt;&lt;/div&gt;&lt;div align="center"&gt; &lt;/div&gt;&lt;div align="left"&gt;Have a nice day.  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-1444030839488844866?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/1444030839488844866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/07/i-know-its-been-so-long.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/1444030839488844866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/1444030839488844866'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/07/i-know-its-been-so-long.html' title='I know it&apos;s been so long...'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-7332360510964625074</id><published>2009-03-07T18:08:00.000-06:00</published><updated>2009-03-07T18:12:39.215-06:00</updated><title type='text'>So here we have our 1st problem...</title><content type='html'>Hey all of you,&lt;br /&gt;I got such an interesting problem, a friend of mine is modelling something using bayesian statistics and she got an equation system to solve, but she's stucked and she showed to me such a long script to ty to solve it with numeric approximation, anyone has any idea about how to solve it?&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_NDm0inJ4HF4/SbMNN_MFALI/AAAAAAAAACE/4D9GGPN3gog/s1600-h/equation+system.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5310602919551500466" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 157px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_NDm0inJ4HF4/SbMNN_MFALI/AAAAAAAAACE/4D9GGPN3gog/s320/equation+system.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; As you can see we're talking about the normal distribution function, so.... let's see if any of you has any idea about how to solve this.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-7332360510964625074?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/7332360510964625074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/03/so-here-we-have-our-1st-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/7332360510964625074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/7332360510964625074'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/03/so-here-we-have-our-1st-problem.html' title='So here we have our 1st problem...'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_NDm0inJ4HF4/SbMNN_MFALI/AAAAAAAAACE/4D9GGPN3gog/s72-c/equation+system.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8187876860689246411.post-3343962757478602427</id><published>2009-03-07T17:54:00.000-06:00</published><updated>2009-03-07T18:07:22.278-06:00</updated><title type='text'>Hello everybody</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_NDm0inJ4HF4/SbMLlyfDQPI/AAAAAAAAAB8/Op6dHcY4iLM/s1600-h/r+growth.jpg"&gt;&lt;/a&gt;&lt;br /&gt;Well... I don’t really know what to write, but Iknow that I want to say ‘Welcome’ to all of you who are checking this blog, I’m a student, majoring in Actuarial Science in Mexico city, and I thought about a place where we could share ideas and knowledge about R (&lt;a href="http://www.r-project.org/"&gt;http://www.r-project.org/&lt;/a&gt;), so I’m gonna post different problems to solve here together, and please if u have something to share contact me so I can post it here ok?&lt;br /&gt;&lt;br /&gt;Greetings from Mexico : )&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5310601129435021554" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 283px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_NDm0inJ4HF4/SbMLlyfDQPI/AAAAAAAAAB8/Op6dHcY4iLM/s320/r+growth.jpg" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8187876860689246411-3343962757478602427?l=using-r-project.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://using-r-project.blogspot.com/feeds/3343962757478602427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://using-r-project.blogspot.com/2009/03/hello-everybody.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/3343962757478602427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8187876860689246411/posts/default/3343962757478602427'/><link rel='alternate' type='text/html' href='http://using-r-project.blogspot.com/2009/03/hello-everybody.html' title='Hello everybody'/><author><name>the R user...</name><uri>http://www.blogger.com/profile/04537587865878296853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_NDm0inJ4HF4/TQAS8P9VnwI/AAAAAAAAAJI/J1kASoi1Cdo/S220/eu.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NDm0inJ4HF4/SbMLlyfDQPI/AAAAAAAAAB8/Op6dHcY4iLM/s72-c/r+growth.jpg' height='72' width='72'/><thr:total>4</thr:total></entry></feed>
