Skip to content

Posts from the ‘Tourism’ Category

Visualising Tourism Data using R with googleVis package


Inspired by Mages’s post on Accessing and plotting World bank data with R (using googleVis package), I created one visualising tourism receipts and international tourist  arrivals of various countries since 1995. The data used are from the World Bank’s country indicators.

To see the motion chart, double click a picture below.

Tourism googleVis

R_logo_small

 Code

install.packages("googleVis")
library('googleVis')

getWorldBankData <- function(id='SP.POP.TOTL', date='1960:2010',
 value="value", per.page=12000){
 require(RJSONIO)
 url <- paste("http://api.worldbank.org/countries/all/indicators/", id,
 "?date=", date, "&format=json&per_page=", per.page,
 sep="")

 wbData <- fromJSON(url)[[2]]

 wbData = data.frame(
 year = as.numeric(sapply(wbData, "[[", "date")),
 value = as.numeric(sapply(wbData, function(x)
 ifelse(is.null(x[["value"]]),NA, x[["value"]]))),
 country.name = sapply(wbData, function(x) x[["country"]]['value']),
 country.id = sapply(wbData, function(x) x[["country"]]['id'])
 )

 names(wbData)[2] <- value

 return(wbData)
}

getWorldBankCountries <- function(){
 require(RJSONIO)
 wbCountries <-
 fromJSON("http://api.worldbank.org/countries?per_page=12000&format=json")
 wbCountries <- data.frame(t(sapply(wbCountries[[2]], unlist)))
 wbCountries$longitude <- as.numeric(wbCountries$longitude)
 wbCountries$latitude <- as.numeric(wbCountries$latitude)
 levels(wbCountries$region.value) <- gsub(" \\(all income levels\\)",
 "", levels(wbCountries$region.value))
 return(wbCountries)
}

## Create a string 1960:this year, e.g. 1960:2011
years <- paste("1960:", format(Sys.Date(), "%Y"), sep="")

## International Tourism Arrivals
inter.tourist.arrivals<- getWorldBankData(id='ST.INT.ARVL',
 date=years, value="International tourism, number of arrivals")

## International Tourism Receipts
tourism.receipts <- getWorldBankData(id='ST.INT.RCPT.CD', date=years,
 value="International tourism, receipts (current US$)")

## Population
population <- getWorldBankData(id='SP.POP.TOTL', date=years,
 value="population")

## GDP per capita (current US$)
GDP.per.capita <- getWorldBankData(id='NY.GDP.PCAP.CD',
 date=years,
 value="GDP.per.capita.Current.USD")

## Merge data sets
wbData <- merge(tourism.receipts, inter.tourist.arrivals)
wbData <- merge(wbData, population)
wbData <- merge(wbData, GDP.per.capita)

## Get country mappings
wbCountries <- getWorldBankCountries()

## Add regional information
wbData <- merge(wbData, wbCountries[c("iso2Code", "region.value",
 "incomeLevel.value")],
 by.x="country.id", by.y="iso2Code")

## Filter out the aggregates and country id column
subData <- subset(wbData, !region.value %in% "Aggregates" , select=
 -country.id)

## Create a motion chart
M <- gvisMotionChart(subData, idvar="country.name", timevar="year",
 options=list(width=700, height=600))

## Display the chart in your browser
plot(M)

# save as a file
print(M, file="myGoogleVisChart.html")

Tourism Conferences 2012, 2013, 2014


2014

  1. Taking responsibility for the visitor economy: Events, tourism, hospitality, sport, leisure and the local community
    Leeds, UK

2013

  1. World Research Summit for Tourism and Hospitality
    Florida, USA, 15-17 December 2013
  2. The 3rd Advances in Hospitality and Tourism Marketing & Management Conference
    T
    aiwan
  3. Celebrating and Enhancing the Tourism Knowledge-based Platform: A Tribute to Jafar Jafari
    S
    pain
  4. 4th Conference of the International Association for Tourism Economics (pdf)
    Slovenia
  5. 2013 Annual TTRA International Conference
    USA
  6. 18th Annual Graduate Education & Graduate Student Research Conference in Hospitality and Tourism
    USA
  7. Geography of Tourism Conference
    U
    K
  8. International Conference on Tourism, Transport and Logistics (ICTTL)
    France
  9. APTA
    Bangkok, Thailand, 1-4 July
  10. Word Convention on Hospitality, Tourism and Event Research & International Convention & Expo Summit 2013 (Double bill!!)
    25 – 28 May 2013
    Hosted by: Siam University, Bangkok, Thailand

2012

  1. International Conferences on Tourism (ICOT)
    Cyprus
  2. 2012 ATLAS Business Tourism Special Interest Group Conference in Lugano
    Switzerland

Testing R Markdown with R Studio and posting it on RPubs.com


Today R Studio has announced  RPubs.com, a new platform to publish an R Markdown document in html format.

It seems that RStudio is a very fast growing IDE for not only data analysis in R but also for reproducible report in PDF and HTML using R and knitr package.

I then tried to create an R Markdown file  with R Studio for my recent data visualisation for Thai tourist data.

And here is my first published HTML report using R Markdown with RStudio.

The following is the code in the R Markdown file.


Visualising International Tourist Arrival
========================================================

by **Pairach Piboonrungroj**
email: <me@pairach.com>
twitter: [@piboonrungroj](https://twitter.com/#!/Piboonrungroj)

This is a test for an R Markdown document using my analysis of *tourist data of Thailand*.
You may see the original post in [my website](https://pairach.com/2012/05/31/using-r-to-analysis-tourism-data-1/)

Tourism is an important sector in the global economy. In many countries, tourism is the main source of revenue, Thailand is one of them. However, tourism sector is a fast moving sector. It is very sensitive to various factors and also vulnerable. The tourism markets for each destination (country) are also very diverse. Tourism data are available and updated frequently. One of the most important report of national tourism statistics; number of tourist arrivals from each country of origin, their average length of stay and total receipt or expenditure. These tourism statistics are important but often reported separately due to the limitation of software used by analysts.

The following are the steps to produce a comprehensive profile of international tourists in Thailand in 2005 with ggplot2 package in R.

### 1: Import data into R
```{r}
exp05 <- read.csv("http://dl.dropbox.com/u/46344142/thai_tour_2005.csv", head = T)
```

### 2: Load 'ggplot2' package for plotting elegant data visualisation
```{r}
library(ggplot2)
```

### 3: Specify x and y axis, label, size of the bubbles and colour of the region
```{r fig.width=7, fig.height=6}
exp <- ggplot(exp05, aes(x=number, y=length, label=country, size=receipt, colour = region))
```

### 4: Create a plot and add texts to x and y axis
```{r fig.width=11, fig.height=6}
exp + geom_point() + geom_text(hjust=0.7, vjust=2) + labs(x = "Number of Tourist Arrivals", y = "Length of Stay (days)") + scale_area("Receipt (M. USD)") + scale_colour_hue("Region")
```

Using R to Analyse Tourism Data – Part 1: Visualising Tourist Profile


Tourism is an important sector in the global economy. In many countries, tourism is the main source of revenue, Thailand is one of them. However, tourism sector is a fast moving sector. It is very sensitive to various factors and also vulnerable. The tourism markets for each destination (country) are also very diverse. Tourism data are available and updated frequently. One of the most important report of national tourism statistics; number of tourist arrivals from each country of origin, their average length of stay and total receipt or expenditure. These tourism statistics are important but often reported separately due to the limitation of software used by analysts.

The following graph represents profile of international tourists in Thailand in 2005.

The picture above was produced in R with package ‘ggplot2’ using the code below.


# Step 1: Import data into R
exp05 <- read.csv("http://dl.dropbox.com/u/46344142/thai_tour_2005.csv", head = T)
# Step 2: Load 'ggplot2' package for plotting elegent data visualisation
library(ggplot2)
# Step 3: Specify x and y axis, label, size of the bubbles and colour of the region
exp <- ggplot(exp05, aes(x=number, y=length, label=country, size=receipt, colour = region))
# Step 4: Create a plot and add texts to x and y axis
exp + geom_point() + geom_text(hjust=0.7, vjust=2) + labs(x = "Number of Tourist Arrivals", y = "Length of Stay (days)") + scale_area("Receipt (M. USD)") + scale_colour_hue("Region")

Tourism Associations and Agencies in Thailand – รายชื่อสมาคมและหน่วยงานด้านการท่องเที่ยวในประเทศไทย


หน่วยงานภาครัฐ

  1. กรมการท่องเที่ยว (Department of Tourism)
  2. กระทรวงการท่องเที่ยว และ กีฬา (Ministry of Tourism and Sports)
  3. การท่องเที่ยวแห่งประเทศไทย (Tourism Authority of Thailand)

ระดับประเทศ

  1. สภาอตสาหกรรมท่องเที่ยวแห่งประเทศไทย (Thailand Tourism Council)
  2. สมาคมโรงแรมไทย (Thai Hotel Association)
  3. สมาคมสปาไทย (Thai Spa Association)

ระดับภาค

  1. สมาคมโรงแรมภาคอีสาน

ระดับจังหวัด

  1. เชียงใหม่
    สมาคมธุรกิจท่องเที่ยวจังหวัดเชียงใหม่ (Chiang Mai Tourism Business Association)
    สมาคมมัคคุเทศน์ เชียงใหม่ (Chiang Mai Guide Association) 
  2. สมาคมธุรกิจท่องเที่ยวจังหวัดภูเก็ต (Phuket Tourist Association)
  3. สมาคมธุรกิจการท่องเที่ยว จังหวัดพิษณุโลก
  4. สมาคมท่องเที่ยวเกาะสมุย (Tourism Association of Koh Samui)
  5. สมาคมการท่องเที่ยวและโรงแรมจังหวัดตรัง (Trang Tourism and Hotel Association)
  6. ศูนย์ข้อมูลการท่องเที่ยวจังหวัดนครศรีธรรมราช
  7. สมาคมสมาพันธ์ธุรกิจการท่องเที่ยว จังหวัดสงขลา (Tourists Business Federation of Songkhla)
%d bloggers like this: