shinyのファイル (ui.R, server.R)の前に、動作確認をR scriptファイル上で確認
ui.Rは、フォームやタブを追加したら、その都度動作を確認
shinyアプリケーション作成時に、エラーが起きた場合は、直前の動いていた状態に戻れるように、少しずつ作成すること
test2<-"With the COVID-19 pandemic worsening in areas of Japan beyond the capital, the government is expected to extend the nation’s second state of emergency Wednesday to cover Osaka, Kyoto and Hyogo prefectures in the Kansai region, as well as Aichi and Gifu prefectures."
lineLst <- unlist(strsplit(test2, ",|\\."))
lineLst[3:4]
## [1] " Kyoto and Hyogo prefectures in the Kansai region"
## [2] " as well as Aichi and Gifu prefectures"
source("netwkPairsBis.R")
getPairsL(lineLst[4])
## [,1] [,2]
## pair "as" "well"
## pair "as" "as"
## pair "aichi" "as"
## pair "and" "as"
## pair "as" "gifu"
## pair "as" "prefectures"
## pair "as" "well"
## pair "aichi" "well"
## pair "and" "well"
## pair "gifu" "well"
## pair "prefectures" "well"
## pair "aichi" "as"
## pair "and" "as"
## pair "as" "gifu"
## pair "as" "prefectures"
## pair "aichi" "and"
## pair "aichi" "gifu"
## pair "aichi" "prefectures"
## pair "and" "gifu"
## pair "and" "prefectures"
## pair "gifu" "prefectures"
pFreq <- getPairsFreqL(lineLst)
head(pFreq)
## Term1 Term2 Freq
## 1 the with 2
## 2 covid-19 with 1
## 3 pandemic with 1
## 4 with worsening 1
## 5 in with 1
## 6 areas with 1
library(igraph)
##
## Attaching package: 'igraph'
## The following objects are masked from 'package:stats':
##
## decompose, spectrum
## The following object is masked from 'package:base':
##
## union
pFreq_s<-pFreq[pFreq$Freq>1,]
wng<-as.undirected(graph.data.frame(pFreq_s))
E(wng)$weight<-pFreq_s$Freq
deg<-degree(wng)
plot(wng,edge.width=5*E(wng)$weight/max(E(wng)$weight),vertex.size=30*(deg/max(deg)))
test3<-"菅 総理 大臣 は 、 大阪 、 愛知 、 福岡 など 合わせ て 7 つ の 府 県 を 対象 に 、 新型 コロナ ウイルス 対策 の 特別 措置 法 に 基づく 、 緊急 事態 宣言 を 出し まし た 。
期間 は 来月 7 日 まで で 、 これ に よっ て 宣言 の 対象 地域 は 1 1 の 都 府 県 に 拡大 さ れ ます 。 "
lineLstJa <- unlist(strsplit(test3, "、|。|\n"))
lineLstJa <- lineLstJa[lineLstJa != " "]
lineLstJa[3:4]
## [1] " 愛知 "
## [2] " 福岡 など 合わせ て 7 つ の 府 県 を 対象 に "
pFreq <- getPairsFreqL(lineLstJa)
head(pFreq)
## Term1 Term2 Freq
## 1 総理 菅 1
## 2 大臣 菅 1
## 3 は 菅 1
## 4 大臣 総理 1
## 5 は 総理 1
## 6 は 大臣 1
par(family = "IPAexGothic")
wng_ja<-as.undirected(graph.data.frame(pFreq))
E(wng_ja)$weight<-pFreq$Freq
deg<-degree(wng_ja)
plot(wng_ja,edge.width=5*E(wng_ja)$weight/max(E(wng_ja)$weight),vertex.size=30*(deg/max(deg)))
library(shiny)
library(d3Network)
runApp("app_netwk_ja")
library(showtext)
## Loading required package: sysfonts
## Loading required package: showtextdb
font_install(source_han_serif())
head(font_files())
showtext_auto()
plot(0,0,type="n")
text(0,0,"我们外语学院",cex=5)
showtext_auto(FALSE)
showtext_auto()
plot(0,0,type="n")
text(0,0,"緊急事態",cex=5)
showtext_auto(FALSE)
showtext_auto()
plot(0,0,type="n")
text(0,0,"고맙습니다",cex=5)
showtext_auto(FALSE)