cufu_textcoord: cufu_textcoord

Usage Arguments Note Author(s) Examples

View source: R/customized functions.R

Usage

1
cufu_textcoord(A_ca, B_ca)

Arguments

A_ca

output of the performance of correspondence analysis on word matrix A 'A_ca = ca(d_A)'

B_ca

output of the performance of correspondence analysis on word matrix B 'B_ca = ca(d_B)'

Note

This package is built to simplify the code in the final report of Methods of Corpus Linguistics

Author(s)

Christine Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## The function is currently defined as
function(A_ca, B_ca){

  text_coord_A <- row_pcoord(A_ca)                # coordinates of texts
  text_coord_B <- row_pcoord(B_ca)

  A_texts_df <- tibble(
    text = A_short_fnames,
    sub_corp = 'First Decade',
    x = text_coord_A[, 1],
    y = text_coord_A[, 2])

  B_texts_df <- tibble(
    text = B_short_fnames,
    sub_corp = 'Second Decade',
    x = text_coord_B[, 1],
    y = text_coord_B[, 2])

  texts_df <- rbind(A_texts_df, B_texts_df)

  return(texts_df)
}

Christine-Z/cufu documentation built on Jan. 4, 2022, 12:01 a.m.