INSTRUCTIONS

Create a web page presentation using R Markdown that features a plot created with Plotly. Host your webpage on either GitHub Pages, RPubs, or NeoCities. Your webpage must contain the date that you created the document, and it must contain a plot created with Plotly. We would love to see you show off your creativity!

REVIEW CRITERIA

The rubric contains the following two questions:

library(plotly)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.3.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

LOADING THE DATA

data <- read.csv("whc-sites-2019.csv")
head(data,10)
##    category states_name_en                region_en unique_number id_no rev_bis
## 1  Cultural    Afghanistan     Asia and the Pacific           230   208     Rev
## 2  Cultural    Afghanistan     Asia and the Pacific           234   211     Rev
## 3  Cultural        Albania Europe and North America          1590   569     Bis
## 4  Cultural        Albania Europe and North America          1563   570     ter
## 5  Cultural        Algeria              Arab States           111   102        
## 6     Mixed        Algeria              Arab States           198   179        
## 7  Cultural        Algeria              Arab States           209   188        
## 8  Cultural        Algeria              Arab States           212   191        
## 9  Cultural        Algeria              Arab States           214   193        
## 10 Cultural        Algeria              Arab States           215   194        
##                                                                name_en
## 1  Cultural Landscape and Archaeological Remains of the Bamiyan Valley
## 2                            Minaret and Archaeological Remains of Jam
## 3                           Historic Centres of Berat and Gjirokastra 
## 4                                                              Butrint
## 5                                              Al Qal'a of Beni Hammad
## 6                                                      Tassili n'Ajjer
## 7                                                         M'Zab Valley
## 8                                                              Djémila
## 9                                                               Tipasa
## 10                                                              Timgad
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            short_description_en
## 1                                                                                                                                                                                                                                                                             The cultural landscape and archaeological remains of the Bamiyan Valley represent the artistic and religious developments which from the 1st to the 13th centuries characterized ancient Bakhtria, integrating various cultural influences into the Gandhara school of Buddhist art. The area contains numerous Buddhist monastic ensembles and sanctuaries, as well as fortified edifices from the Islamic period. The site is also testimony to the tragic destruction by the Taliban of the two standing Buddha statues, which shook the world in March 2001. 
## 2                                                                                                                                                                                                                                                                                                                                                                   The 65m-tall Minaret of Jam is a graceful, soaring structure, dating back to the 12th century. Covered in elaborate brickwork with a blue tile inscription at the top, it is noteworthy for the quality of its architecture and decoration, which represent the culmination of an architectural and artistic tradition in this region. Its impact is heightened by its dramatic setting, a deep river valley between towering mountains in the heart of the Ghur province. 
## 3   Berat and Gjirokastra are inscribed as rare examples of an architectural character typical of the Ottoman period. Located in central Albania, Berat bears witness to the coexistence of various religious and cultural communities down the centuries. It features a castle, locally known as the Kala, most of which was built in the 13th century, although its origins date back to the 4th century BC. The citadel area numbers many Byzantine churches, mainly from the 13th century, as well as several mosques built under the Ottoman era which&nbsp;began&nbsp;in 1417. Gjirokastra, in the Drinos river valley in southern Albania, features a series of outstanding two-story&nbsp;houses which were developed in the 17th century. The town also retains a bazaar, an 18th-century mosque and two churches of the same period. 
## 4                                                                                                                                                                                                                                                                                                                                                                                                                 Inhabited since prehistoric times, Butrint has been the site of a Greek colony, a Roman city and a bishopric. Following a period of prosperity under Byzantine administration, then a brief occupation by the Venetians, the city was abandoned in the late Middle Ages after marshes formed in the area. The present archaeological site is a repository of ruins representing each period in the city&rsquo;s development. 
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         In a mountainous site of extraordinary beauty, the ruins of the first capital of the Hammadid emirs, founded in 1007 and demolished in 1152, provide an authentic picture of a fortified Muslim city. The mosque, whose prayer room has 13 aisles with eight bays, is one of the largest in Algeria. 
## 6                                                                                                                                                                                                                                                                                                                                                     Located in a strange lunar landscape of great geological interest, this site has one of the most important groupings of prehistoric cave art in the world. More than 15,000 drawings and engravings record the climatic changes, the animal migrations and the evolution of human life on the edge of the Sahara from 6000 BC to the first centuries of the present era. The geological formations are of outstanding scenic interest, with eroded sandstones forming ‘forests of rock’. 
## 7                                                                                                                                                                                                                                                                                                                                                                                                                               A traditional human habitat, created in the 10th century by the Ibadites around their five <em>ksour</em> (fortified cities), has been preserved intact in the M’Zab valley. Simple, functional and perfectly adapted to the environment, the architecture of M’Zab was designed for community living, while respecting the structure of the family. It is a source of inspiration for today’s urban planners. 
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Situated 900 m above sea-level, Dj&eacute;mila, or Cuicul, with its forum, temples, basilicas, triumphal arches and houses, is an interesting example of Roman town planning adapted to a mountain location. 
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                    On the shores of the Mediterranean, Tipasa was an ancient Punic trading-post conquered by Rome and turned into a strategic base for the conquest of the kingdoms of Mauritania. It comprises a unique group of Phoenician, Roman, palaeochristian and Byzantine ruins alongside indigenous monuments such as the Kbor er Roumia, the great royal mausoleum of Mauretania. 
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Timgad lies on the northern slopes of the Aurès mountains and was created <em>ex nihilo</em> as a military colony by the Emperor Trajan in AD 100. With its square enclosure and orthogonal design based on the <em>cardo</em> and <em>decumanus</em>, the two perpendicular routes running through the city, it is an excellent example of Roman town planning. 
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       justification_en
## 1   <em>Criterion (i):</em> The Buddha statues and the cave art in Bamiyan Valley are an outstanding representation of the Gandharan school in Buddhist art in the Central Asian region. \n <em>Criterion (ii)</em> : The artistic and architectural remains of Bamiyan Valley, and an important Buddhist centre on the Silk Road, are an exceptional testimony to the interchange of Indian, Hellenistic, Roman, Sasanian influences as the basis for the development of a particular artistic expression in the Gandharan school. To this can be added the Islamic influence in a later period. \n <em>Criterion (iii):</em> The Bamiyan Valley bears an exceptional testimony to a cultural tradition in the Central Asian region, which has disappeared. \n <em>Criterion (iv):</em> The Bamiyan Valley is an outstanding example of a cultural landscape which illustrates a significant period in Buddhism. \n <em>Criterion (vi):</em> The Bamiyan Valley is the most monumental expression of the western Buddhism. It was an important centre of pilgrimage over many centuries. Due to their symbolic values, the monuments have suffered at different times of their existence, including the deliberate destruction in 2001, which shook the whole world. 
## 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <em>Criterion (ii):</em> The innovative architecture and decoration of the Minaret of Jam played a significant role in the development of the arts and architecture of the Indian sub-continent and beyond. \n <em>Criterion (iii): </em>The Minaret of Jam and its associated archaeological remains constitute exceptional testimony to the power and quality of the Ghurid civilization that dominated its region in the 12th and 13th centuries. \n <em>Criterion (iv): </em>The Minaret of Jam is an outstanding example of Islamic architecture and ornamentation in this region and played a significant role in their further dissemination. 
## 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
## 10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
##    date_inscribed secondary_dates danger date_end danger_list longitude
## 1            2003                      1       NA      Y 2003 67.825250
## 2            2002                      1       NA      Y 2002 64.515889
## 3            2005            2008      0       NA             20.133333
## 4            1992            1999      0     2005 P 1997-2005 20.026111
## 5            1980                      0       NA              4.786840
## 6            1982                      0       NA              9.000000
## 7            1982                      0       NA              3.683330
## 8            1982                      0       NA              5.736670
## 9            1982                      0     2006 P 2002-2006  2.383333
## 10           1982                      0       NA              6.468861
##    latitude area_hectares         criteria_txt category_short iso_code
## 1  34.84694      158.9265 (i)(ii)(iii)(iv)(vi)              C       af
## 2  34.39642       70.0000        (ii)(iii)(iv)              C       af
## 3  40.06944       58.9000            (iii)(iv)              C       al
## 4  39.75111            NA                (iii)              C       al
## 5  35.81844      150.0000                (iii)              C       dz
## 6  25.50000  7200000.0000  (i)(iii)(vii)(viii)              M       dz
## 7  32.48333      665.0300         (ii)(iii)(v)              C       dz
## 8  36.32056       30.6000            (iii)(iv)              C       dz
## 9  36.55000       52.1600            (iii)(iv)              C       dz
## 10 35.48417       90.5400        (ii)(iii)(iv)              C       dz
##    udnp_code transboundary
## 1        afg             0
## 2        afg             0
## 3        alb             0
## 4        alb             0
## 5        dza             0
## 6        dza             0
## 7        dza             0
## 8        dza             0
## 9        dza             0
## 10       dza             0

Set the data for the graphs:

We are going to generate a simple bar graph showing the ammount of sites based on their type.

plot1 <- data %>%
  select(Category = category) %>%
  mutate(n = 1) %>%
  group_by(Category) %>%
  summarise(Total = sum(n))

plot1df <- as.data.frame(plot1)

VISUALIZATION

Now we are going to generate the bar graph

#Basic Layout of the Graph

plot1graph <- plot_ly(x = plot1df$Category,
                 y = plot1df$Total,
                 color = plot1df$Category,
                 type = "bar",
                 marker = list( ine = list(color = 'black',
                                           width = 1.5)))

plot1graph
# Further customization

plot1graph <- plot1graph %>% 
  layout(title = "Site Distribution",
         xaxis = list(title = "Type"),
         yaxis = list(title = "Total"),
         paper_bgcolor = 'rgba(245, 246, 249, 1)',
         plot_bgcolor = 'white',
         showlegend = FALSE)

plot1graph