-4
共著者のPubMedの出版物(226レコード)の2部グラフを作成する私の最初の試み。以下は、入力ファイル(一つだけCSVライン)のサンプルである:Rデータを.GEXF形式に変換する
11810598;Chêne G, Angelini E, Cotte L, Lang JM, Morlat P, Rancinan C, May T, Journot V, Raffi F, Jarrousse B, Grappin M, Lepeu G, Molina JM;2002;Mar;Role of long-term nucleoside-analogue therapy in lipodystrophy and metabolic disorders in human immunodeficiency virus-infected patients.
> InputFile = 'JMMolina_PubMed.csv'
# Read the CSV input file into the initial JMMpubs data frame
> setwd('~/Dropbox/R')
> JMMpubs <- read.csv(file=InputFile , header =
> FALSE , sep = ";" , strip.white = TRUE)
> names(JMMpubs) <- c("ID","AuthList", "Year", "Month", "Title")
# build a new data frame IdAuth with one Id line for each coauthor
# therefor the first article which has 13 co-authors will generate 13 lines with the same Id
> Authors <- strsplit(as.character(JMMpubs$AuthList), split = ", ")
> IdAuth <- data.frame(Id = rep(JMMpubs$ID, sapply(Authors,length)), Author = unlist(Authors))
# Now I would like to export this data to Gephi
# The nodes of the graph should be the UNIQUE names in Authors
> UniqueAuthors <- unique(unlist(Authors))
グラフのエッジはIdAuth
の各列でなければなりません。出版物の年を各辺に関連付ける(最新の辺を赤く塗りつぶし、古いものを淡い色で塗りつぶす)。