deepsense.aideepsense.ai logo
  • Careers
    • Job Offers
    • Summer Internship
  • Clients’ stories
  • Services
    • Customized AI software
    • Team augmentation
    • AI advisory
    • Train your team
  • Industries
    • Retail
    • Manufacturing
    • Financial & Insurance
    • IT Operations
    • TMT & Other
    • Medical & Beauty
  • Knowledge base
    • Blog
    • R&D Hub
  • About us
    • Our story
    • Management
    • Advisory Board
    • Press center
  • Contact
  • Menu Menu
Sapkowski, Dukaj and the wikipediatrend package

Sapkowski, Dukaj and the wikipediatrend package

July 16, 2015/in Data science /by Przemyslaw Biecek

Recently I tested a quite nice package for R: wikipediatrend (available on CRAN). With just a few lines of code, it can easily download and visualize daily wikipedia page views statistics. Great package, so we are going to take a closer look. I’ve just finished Season of Storms (Andrzej Sapkowski, part of The Witcher saga) and The Old Axolotl (Jacek Dukaj). Let’s see if there is any relation between page views statistics and publication dates for these two books.

First: download the data. With the function wp_trend it’s enough to set page names (here: The Wither and Axolotl), languages (here: Polish and English) and the time period (let’s see what is happening since the beginning of 2013).
Then: use the ggplot2 package to plot the data. Note, that you can retrieve the figure presented below directly to R with the hook: archivist::aread(“pbiecek/graphGallery/25fbc8bc66bbf02fe66b7715ff53b083”).

library(wikipediatrend)
wp = wp_trend(page = c("Aksolotl","Axolotl","The_Witcher", "Wiedzmin"),
               from = "2013-01-01",
               to   = today(),
               lang = c("pl","en","en","pl"))
head(wp)
##   date       count lang page     rank month  title
## 1 2013-08-26 70    pl   Aksolotl  -1  201308 Aksolotl
## 2 2013-08-27 74    pl   Aksolotl  -1  201308 Aksolotl
## 3 2013-08-28 69    pl   Aksolotl  -1  201308 Aksolotl
## 4 2013-08-19 83    pl   Aksolotl  -1  201308 Aksolotl
## 5 2013-08-18 71    pl   Aksolotl  -1  201308 Aksolotl
## 6 2013-08-31 87    pl   Aksolotl  -1  201308 Aksolotl
library(ggplot2)
# note that OY axis is sqrt transformed
ggplot(wp, aes(date, count, group=page, color = page)) +
  geom_point(alpha=0.5) +
  geom_smooth(size=1.5, se=FALSE, span=0.1) +
  theme_bw() + scale_y_sqrt(limits=c(0,20000)) +
  facet_grid(lang~.)

wikipediatrend package
Few important dates, that may help to understand this figure. Season of Storms was published on Nov 6, 2013 and you can notice a small bump around this date. In 2014 it gets translated to few languages. But noticeably the largest impact on page views statistics has the release of the computer game: The Wither 3: Wild Hunt (release: May 19, 2015). The Old Axolotl was published in 2015, yet it is not that easy to see any larger change in page views statistics.
What about statistics of Sapkowski and Dukaj wikipages?
Again, it takes just two lines of R code to download and plot required data.
In the figure below it is easier to spot bumps around publication dates for both books and the game.

wp = wp_trend(page = c("Andrzej_Sapkowski","Andrzej_Sapkowski","Jacek_Dukaj", "Jacek_Dukaj"),
               from = "2013-01-01",
               to   = today(),
               lang = c("pl","en","pl","en"))
head(wp)
##   date       count lang page              rank month  title
## 1 2013-01-12 464   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
## 2 2013-01-13 538   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
## 3 2013-01-10 536   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
## 4 2013-01-11 457   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
## 5 2013-01-16 540   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
## 6 2013-01-17 541   pl   Andrzej_Sapkowski 1366 201301 Andrzej_Sapkowski
ggplot(wp, aes(date, count, group=page, color = page)) +
  geom_point(alpha=0.5) +
  geom_smooth(size=1.5, se=FALSE, span=0.1) +
  theme_bw() + scale_y_sqrt() +
  facet_grid(lang~.)

wikipediatrend package 1

Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://deepsense.ai/wp-content/uploads/2019/02/Sapkowski-Dukaj-and-the-wikipediatrend-package.jpg 337 1140 Przemyslaw Biecek https://deepsense.ai/wp-content/uploads/2019/04/DS_logo_color.svg Przemyslaw Biecek2015-07-16 09:00:252021-01-05 16:53:31Sapkowski, Dukaj and the wikipediatrend package

Start your search here

NEWSLETTER SUBSCRIPTION

    You can modify your privacy settings and unsubscribe from our lists at any time (see our privacy policy).

    This site is protected by reCAPTCHA and the Google privacy policy and terms of service apply.

    THE NEWEST AI MONTHLY DIGEST

    • AI Monthly Digest 20 - TL;DRAI Monthly Digest 20 – TL;DRMay 12, 2020

    CATEGORIES

    • Elasticsearch
    • Computer vision
    • Artificial Intelligence
    • AIOps
    • Big data & Spark
    • Data science
    • Deep learning
    • Machine learning
    • Neptune
    • Reinforcement learning
    • Seahorse
    • Job offer
    • Popular posts
    • AI Monthly Digest
    • Press release

    POPULAR POSTS

    • AI trends for 2021AI trends for 2021January 7, 2021
    • A comprehensive guide to demand forecastingA comprehensive guide to demand forecastingMay 28, 2019
    • What is reinforcement learning? The complete guideWhat is reinforcement learning? The complete guideJuly 5, 2018

    Would you like
    to learn more?

    Contact us!
    • deepsense.ai logo white
    • Services
    • Customized AI software
    • Team augmentation
    • AI advisory
    • Knowledge base
    • Blog
    • R&D Hub
    • deepsense.ai
    • Careers
    • Summer Internship
    • Our story
    • Management
    • Scientific Advisory Board
    • Press center
    • Support
    • Terms of service
    • Privacy policy
    • Contact us
    • Join our community
    • facebook logo linkedin logo twitter logo
    • © deepsense.ai 2014-
    Scroll to top

    This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

    OKLearn more

    Cookie and Privacy Settings



    How we use cookies

    We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

    Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

    Essential Website Cookies

    These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

    Because these cookies are strictly necessary to deliver the website, refuseing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

    We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

    We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

    Other external services

    We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

    Google Webfont Settings:

    Google Map Settings:

    Google reCaptcha Settings:

    Vimeo and Youtube video embeds:

    Privacy Policy

    You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

    Accept settingsHide notification only