Outline
Whitney and Linda started this Zoom online concert program for senior homes in China. Many non-professional volunteers joined the program wish to build a connection between the young generation and seniors.
Special Thanks to Meichen
Color Datatable
<- function(data,var,color,l){
colordatatable(data, options = list(
pageLength = l), escape=FALSE) %>% formatStyle(names(data),
fontSize="80%",
background = styleColorBar(var, color),
backgroundSize = '88% 78%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'left')
}
<- group_by(name1, ins )
ins <- dplyr::summarise(ins, count=n())
ins1
<- readPNG("C:/Users/ftan/OneDrive - Nektar Therapeutics/desktop/All/r/happy/logo.png", native=TRUE)
atry3<- ggplot(ins1, aes(x=reorder(ins,count),y=count))+annotation_raster(atry3, xmin=0.5,xmax=3, ymin=8, ymax=Inf) +
p41 geom_bar(aes(y=count,fill=ins), stat="identity")+ scale_fill_brewer(palette="Set3")+
labs(x="Instrument", y="count",title="Instrument Distribution")+ theme(legend.position="none", axis.text.x = element_text(angle = 90, hjust = 1) ,panel.background = element_rect(fill="white"))+ylim(0,22)
p41
<- group_by(name1, country )
icountry
<- dplyr::summarise(icountry, count=n(), na.rm=TRUE)
ic2 <- joinCountryData2Map(ic2, joinCode="NAME", nameJoinColumn="country") n
## 3 codes from your data successfully matched countries in the map
## 0 codes from your data failed to match with a country code in the map
## 240 codes from the map weren't represented in your data
mapCountryData(n, nameColumnToPlot="count", mapTitle="Player Country Map" , colourPalette = "negpos8")
<- name1 %>%select(date1, year, month)%>% group_by(date1)%>% dplyr::summarise(n=n())%>%
time mutate(Date=lubridate::mdy(date1))%>% arrange(mdy(date1))
ggplot(time, aes(x=Date, y=n)) +
geom_segment( aes(xend=Date, yend=0),color="skyblue",size=2) +
geom_point( size=4, color="orange") +
theme(axis.text.x = element_text(angle = 90, hjust = 1) ,panel.background = element_rect(fill="white")) + scale_x_date(date_labels="%b %Y", breaks = unique(time$Date))+
xlab("Timeline") +ylab("New Volunteer")
color(info, info$ï..no, "orange", 10)
Instrument Distribution
<- info%>% group_by(ins ) %>% summarise( count=n())
pins
<- readPNG("C:/Users/ftan/OneDrive - Nektar Therapeutics/desktop/All/r/happy/piano.png", native=TRUE)
atry4
<- ggplot(pins, aes(x=reorder(ins,count),y=count))+annotation_raster(atry4, xmin=0.4,xmax=6, ymin=15, ymax=Inf) +
pins1 geom_bar(aes(y=count,fill=ins), stat="identity")+ scale_fill_brewer(palette="Set3")+
labs(x="Instrument", y="count",title="Instrument Distribution for Concerts")+ theme(legend.position="none", axis.text.x = element_text(angle = 90, hjust = 1) ,panel.background = element_rect(fill="white"))+ylim(0,50)
pins1
Top Contributor
<- info%>% group_by(player,ins) %>% summarise( concert=n()) %>% arrange(-concert)
ptop color(ptop, ptop$concert, "#a1d4bd", 4)
<- name1%>% group_by(year) %>% summarise( concert=n()) pp
Participate Ratio
<- info%>% group_by(year,player)%>% dplyr:: summarise(player=n_distinct(player))
rt <- rt %>% group_by(year)%>%dplyr:: summarise(player=n()) %>% mutate(ratio=ifelse(year==2021,round(player/29,2),round(player/37,2)))
rt1 color(rt1, rt1$ratio, "#FB8072", 2)
<- info%>% group_by(seniorhome,ins) %>% summarise( count=round(n()/3,0))
phome
<- ggplot(phome, aes(x=reorder(seniorhome,count),y=count))+
ph1 geom_bar(aes(y=count,fill=ins), stat="identity")+ scale_fill_brewer(palette="Set3")+
labs(x="Senior Home", y="count",title="Concerts by Senior Home")+ theme(legend.position="right", axis.text.x = element_text(angle = 90, hjust = 1) ,panel.background = element_rect(fill="white"))+ylim(0,16)
ph1
<- info%>% group_by(year,location) %>% summarise( count=round(n()/3,0))
cyear<- ggplot(cyear, aes(x=reorder(year,count),y=count))+
py1 geom_bar(aes(y=count,fill=location), stat="identity")+ scale_fill_brewer(palette="Set3")+
labs(x="Timeline", y="count",title="Concerts by year")+ theme(legend.position="right", axis.text.x = element_text(angle = 90, hjust = 1) ,panel.background = element_rect(fill="white"))+ylim(0,40)
py1
In Nanjing,…
<- filter(info, seniorhome=="Oubaoting")%>% group_by(date)%>% dplyr::summarise(n=n())%>%
omutate(Date=lubridate::mdy(date))%>% arrange(mdy(date))
ggplot(o, aes(x=Date, y=n)) +
geom_segment( aes(xend=Date, yend=0),color="#B3DE69",size=2) +
geom_point( size=4, color="#eebc59") +
theme(axis.text.x = element_text(angle = 90, hjust = 1),panel.background = element_rect(fill="white", linetype="solid") ) + scale_x_date(date_labels="%b %Y", breaks = unique(o$Date))+
xlab("Timeline") +ylab("Players") +ggtitle("Oubaoting Concert Overview")
Located in Baoshan and Xipu, grandpas and grandmas give feedbacks
<- filter(info, seniorhome=="Xingbao")%>% group_by(date)%>% dplyr::summarise(n=n())%>%
omutate(Date=lubridate::mdy(date))%>% arrange(mdy(date))
ggplot(o, aes(x=Date, y=n)) +
geom_segment( aes(xend=Date, yend=0),color="#80B1D3",size=2) +
geom_point( size=4, color="#f58726") +
theme(axis.text.x = element_text(angle = 90, hjust = 1),panel.background = element_rect(fill="white", linetype="solid") ) + scale_x_date(date_labels="%b %Y", breaks = unique(o$Date))+
xlab("Timeline") +ylab("Players") +ggtitle("Xingbao Concert Overview")
In Shanghai, grandpas and grandmas are engaged to play instrument and participate as well
<- filter(info, seniorhome=="Jingmei")%>% group_by(date)%>% dplyr::summarise(n=n())%>%
omutate(Date=lubridate::mdy(date))%>% arrange(mdy(date))
ggplot(o, aes(x=Date, y=n)) +
geom_segment( aes(xend=Date, yend=0),color="#BEBADA",size=2) +
geom_point( size=4, color="#FB8072") +
theme(axis.text.x = element_text(angle = 90, hjust = 1),panel.background = element_rect(fill="white", linetype="solid") ) + scale_x_date(date_labels="%b %Y", breaks = unique(o$Date))+
xlab("Timeline") +ylab("Players") +ggtitle("Jingmei Concert Overview")
### Meili Garden
Located in Guiyang, Guilin, and Suzhou, grandpas and grandmas prepared performances
<- filter(info, seniorhome=="MeiliGarden")%>% group_by(date)%>% dplyr::summarise(n=n())%>%
omutate(Date=lubridate::mdy(date))%>% arrange(mdy(date))
ggplot(o, aes(x=Date, y=n)) +
geom_segment( aes(xend=Date, yend=0),color="#8DD3C7",size=2) +
geom_point( size=4, color="coral") +
theme(axis.text.x = element_text(angle = 90, hjust = 1),panel.background = element_rect(fill="white", linetype="solid") ) + scale_x_date(date_labels="%b %Y", breaks = unique(o$Date))+
xlab("Timeline") +ylab("Players") +ggtitle("MeiliGarden Concert Overview")
Word Cloud
#company count
<- filter(info, !is.na(song)) %>%
names group_by(song) %>%
::summarize(count = n())
dplyrset.seed(88)
wordcloud(names$song, freq=names$count, min.freq=1,max.words=200,random.order=FALSE,rot.per=0.5,colors=brewer.pal(8, "Dark2"), main="Song")