Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
massimoaria committed May 10, 2021
1 parent c327750 commit a1cde74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions R/couplingMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ couplingMap <- function(M, analysis = "documents", field="CR", n=500, label.term
df <- df_lab %>%
mutate(centrality = mean(.data$pagerank_centrality),
impact = mean(.data$MNLCS2,na.rm=TRUE),
impact = replace(.data$impact, is.na(.data$impact),NA)) %>%
impact = replace(.data$impact, is.na(.data$impact),0)) %>%
top_n(.data$MNLCS, n=10) %>%
summarize(freq = .data$freq[1],
centrality = .data$centrality[1]*100,
Expand All @@ -132,6 +132,9 @@ couplingMap <- function(M, analysis = "documents", field="CR", n=500, label.term
meancentr <- mean(df$rcentrality)
df <- df[df$freq>=minfreq,]

df_lab<- df_lab %>%
dplyr::filter(.data$group %in% df$group)

rangex <- max(c(meancentr-min(df$rcentrality),max(df$rcentrality)-meancentr))
rangey <- max(c(meandens-min(df$rimpact),max(df$rimpact)-meandens))
xlimits <- c(meancentr-rangex-0.5,meancentr+rangex+0.5)
Expand All @@ -156,7 +159,7 @@ couplingMap <- function(M, analysis = "documents", field="CR", n=500, label.term
x <- c(max(df$rcentrality)-0.02-diff(range(df$rcentrality))*0.125, max(df$rcentrality)-0.02)+0.5
y <- c(min(df$rimpact),min(df$rimpact)+diff(range(df$rimpact))*0.125)

g=ggplot(df, aes(x=.data$rcentrality, y=.data$rimpact, text=(.data$words))) +
g <- ggplot(df, aes(x=.data$rcentrality, y=.data$rimpact, text=(.data$words))) +
geom_point(group="NA",aes(size=log(as.numeric(.data$freq))),shape=20,col=adjustcolor(df$color,alpha.f=0.5)) # Use hollow circles
if (size>0){
if (isTRUE(repel)){
Expand Down
2 changes: 1 addition & 1 deletion R/tableTag.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tableTag <- function(M, Tag = "CR", sep = ";", ngrams=1){
M$C1=gsub("\\[.+?]","",M$C1)
}

Tab<-unlist(strsplit(as.character(M[,i]),sep))
Tab<-unlist(strsplit(as.character(M %>% dplyr::pull(i)),sep))

### inserted to remove punct and extra spaces ####
#Tab<-trimws(trimES(gsub("[[:punct:]]"," ",Tab)))
Expand Down
2 changes: 1 addition & 1 deletion inst/biblioshiny/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,7 @@ navbarMenu("Documents",
),

### COUPLING ----
navbarMenu("Coupling ",
navbarMenu("Clustering ",

#### Coupling ----
" ",
Expand Down

0 comments on commit a1cde74

Please sign in to comment.