get_mds_article_fits.Rd
Multidimensional scaling for article similarity
get_mds_article_fits(num_articles, num_clusters, year_range, input_df, a_vectors = article_vectors)
num_articles | integer, number of articles to select from entire dataframe |
---|---|
num_clusters | integer, number of clusters to generate |
year_range | vector, c(1947,1948) containing beginning to end year |
input_df | dataframe an articles dataframe containing article info and Similarity info (e.g., like the one generated by |
a_vectors | matrix, containing the article vectors (e.g., |
dataframe, a modified version of input_df
containing MDS coordinates and cluster information useful for plotting
columns are:
formatted_column
for printing abstract info HTML
title
abstract title
wrap_title
useful for plotly hover labels
year
abstract year
index
abstract index
Similarity
of search term to abstract
X
x coordinate from MDS
Y
y coodinate from MDS
cluster
from k-means clustering
search <- c("president") article_dataframe<-get_search_article_similarities(search,query_type=1) MDS <- get_mds_article_fits(10,2,c(1947,1948),article_dataframe)