Skip to content

Instantly share code, notes, and snippets.

View kumeS's full-sized avatar

skume kumeS

View GitHub Profile
@kumeS
kumeS / pairs.panelsR.R
Last active June 29, 2020 16:42
Modified pairs.panels function in the psych package
if(!require("psych")){install.packages("psych")}
library(psych)
pairs.panelsR <- function (x, smooth = TRUE, scale = FALSE, density = TRUE, ellipses = TRUE,
digits = 2, method = "pearson", pch = 21, cex.plot=1, lm = FALSE, cor = TRUE,
col1="red", jiggle = FALSE, factor = 2, hist.col = "cyan", show.points = TRUE,
rug = TRUE, breaks = "Sturges", cex.cor = 1, wt = NULL, smoother = FALSE,
stars = FALSE, ci = FALSE, alpha = 0.05, ...)
{
"panel.hist.density" <- function(x, ...) {
@kumeS
kumeS / DBS.R
Last active June 29, 2020 16:24
Data form and Basic Statistics (DBS)
# Data form and Basic Statistics (DBS)
# PDF output of pairs.panelsR plot
if(!require("psych")){install.packages("psych")}
library(psych)
dbs <- function(x, PDFfile=T){
set.seed(125)
dfx <- as.data.frame(x)
@kumeS
kumeS / CreateWikiDataGraph.R
Last active September 8, 2020 03:57
Search the graph strtuctues from WikiData
######################################################################################
### Description: Explore the upper graph structures of subClassOf Class from WikiData.
### Usage ###
## 1. Load the R file
## source("[Raw data URL]")
######################################################################################
## 2. get the subClassOf graph from a class.
## > GraphData <- wikiGraph(ClassName="データサイエンス", Upper=TRUE, lang=TRUE, Depth=8)
## or
## > GraphData <- wikiGraph()
##実行環境
#macOS Catalina 10.15.5
#R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
#Copyright (C) 2020 The R Foundation for Statistical Computing
#Platform: x86_64-apple-darwin15.6.0 (64-bit)
#RStudio Version 1.2.5042
#rm(list=ls())
#sudo rm -rf /Library/Frameworks/R.framework /Applications/R.app #/usr/local/bin/R /usr/local/bin/Rscript
#sudo rm -rf /Users/[YourHostName]/Library/R
## This code was modified from the original code of "andrie/deepviz" (https://github.com/andrie/deepviz)
## The colores of nodes were changed in this version.
pkg.name <- "keras"
if(!require(pkg.name, character.only=TRUE)){
install.packages(pkg.name)
}
library(pkg.name, character.only=TRUE)
pkg.name <- "DiagrammeR"
#How to Build Simple Autoencoder with Keras in R
#https://www.datatechnotes.com/2020/02/how-to-build-simple-autoencoder-with-keras-in-r.html
#Let's play with autoencoders (Keras, R)
#https://statslab.eighty20.co.za/posts/autoencoders_keras_r/
#tf.keras.utils.plot_model
#https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/keras/utils/plot_model
#https://cran.r-project.org/web/packages/imager/vignettes/gettingstarted.html
if(!require("magrittr")){install.packages("magrittr")}; library(magrittr)
if(!require("networkD3")){install.packages("networkD3")}; library(networkD3)
if(!require("htmlwidgets")){install.packages("htmlwidgets")}; library(htmlwidgets)
if(!require("franc")){install.packages("franc")}; library(franc)
if(!require("visNetwork")){install.packages("visNetwork")}; library(visNetwork)
if(!require("DT")){install.packages("DT")}; library(DT)
if(!require("formattable")){install.packages("formattable")}; library(formattable)
if(!require("data.tree")){install.packages("data.tree")}; library(data.tree)
if(!require("htmltools")){install.packages("htmltools")}; library(htmltools)
if(!require("purrr")){install.packages("purrr")}; library(purrr)
@kumeS
kumeS / PublicationPerYear.R
Created June 24, 2020 18:54
Number of PubMed articles containing the keyword.
if(!require("RISmed")){install.packages("RISmed")}; library(RISmed)
if(!require("magrittr")){install.packages("magrittr")}; library(magrittr)
if(!require("purrr")){install.packages("purrr")}; library(purrr)
if(!require("plotly")){install.packages("plotly")}; library(plotly)
if(!require("progress")){install.packages("progress")}; library(progress)
PublicationPerYear <- function(Term="Coronavirus"){
PubNumber <- c()
TERM <- Term
x <- 1
@kumeS
kumeS / Basic_report_jpn.Rmd
Created June 24, 2020 19:10
To create the basic Japanese report.
---
title: "論文レポート"
output: html_document
theme: cerulean
---
<style>
.col2 {
columns: 2 200px; /* number of columns and width in pixels*/
-webkit-columns: 2 200px; /* chrome, safari */
-moz-columns: 2 200px; /* firefox */
@kumeS
kumeS / PubMed_RISmed_googletrans.R
Last active July 10, 2020 10:49
To search the PubMed DB and translate the abstract to the Japanese text.
##RISmed
#https://cran.r-project.org/web/packages/RISmed/index.html
#RISmed: NCBIデータベースからコンテンツをダウンロードするRパッケージである。
#PubMedを含むNational Center for Biotechnology Information (NCBI)
#のデータベースから書誌内容を抽出するためのツール群である。
#参考文献
#https://rpubs.com/Algo1970/116830
#https://datascienceplus.com/search-pubmed-with-rismed/
#https://amunategui.github.io/pubmed-query/