Script Use of Lexicometry in Sensometrics

Figure 4 with the best represented global words in the first plane (cos2 higher than 0.5 in either of the two factors). Names and positions.

sel.12.BRGW <-which((res.mfact.23$freq.sup$cos2[,1]>0.5)|(res.mfact.23$freq.sup$cos2[,2] > 0.5))
sel.12.BRGW

 

plot.MFA(res.mfact.23,choix=c("freq"),invisible=c("row","col"),axes=c(1,2),select=sel.12.BRGW,unselect=1,
legend=list(plot=FALSE),habillage="none",autoLab = c("yes"),cex=0.8,
title="",graph.type="classic")

Figure with the best represented global words in the plane (3,4) (cos2 higher than 0.5 in either of the two factors). Names and positions.

sel.34.BRGW<-which((res.mfact.23$freq.sup$cos2[,3]>0.5)|(res.mfact.23$freq.sup$cos2[,4] > 0.5) )
plot.MFA(res.mfact.23,choix=c("freq"),invisible=c("row","col"),axes=c(3,4),select=sel.34.BRGW,unselect=1,
legend=list(plot=FALSE),habillage="none",autoLab = c("yes"),cex=0.8,
title="The best represented global words",graph.type="classic")

38 characteristic French words for the plane (1,2)

sel.12.BRGW.Fr <-which((res.mfact.23$freq.sup$cos2[c(1:135),1]>0.5)|(res.mfact.23$freq.sup$cos2[c(1:135),2] > 0.5))
sel.12.BRGW.Fr

cat(length(sel.12.BRGW.Fr))

Words12.BRGW.Fr <- data.frame(posit=as.vector(sel.12.BRGW.Fr), wordF4=names(sel.12.BRGW.Fr), lang="Fr")
Words12.BRGW.Fr

 

French translation

df.WTR.Fr <- data.frame(orig= "aspect", transl="aspect")
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "asséchant", transl="drying") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "beau", transl="beautiful") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "bois", transl="wood") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "boisé", transl="woody") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "carton", transl="cardboard") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "charpenté", transl="structured") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "cuit", transl="cooked") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "curieux", transl="curious") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "dominé", transl="dominated") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "étable", transl="stable") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "évent", transl="staleness") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "évolué", transl="evolved") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "évolution", transl="development") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "farineux", transl="floury") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "finale", transl="final") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "fraîcheur", transl="freshness") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "fruit", transl="fruit") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "fumée", transl="smoke") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "généreux", transl="generous") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "humide", transl="wet") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "limite", transl="limit") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "matière", transl="material") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "mou", transl="soft") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "neuf", transl="new") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "noir", transl="black") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "nonboisé", transl="unwooded") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "particulier", transl="particular") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "plat", transl="flat") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "réduction", transl="reduction") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "rond", transl="round") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "sec", transl="dry") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "souple", transl="supple") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "sucrée", transl="sweet") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "sucrosité", transl="sweetness") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "toasté", transl="toasted") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "vanillé", transl="vanillin") )
df.WTR.Fr <- rbind(df.WTR.Fr, data.frame(orig= "vin", transl="wine") )
dim(df.WTR.Fr)

df.WTR.Fr

 

To join French coordinates and their translation:

Coord.Fr.Fig4 <- data.frame(res.mfact.23$freq.sup$coord[sel.12.BRGW.Fr,], lang="Fr")
Coord.Fr.Fig4 <- merge(Coord.Fr.Fig4, df.WTR.Fr, by.x=0, by.y="orig")
Coord.Fr.Fig4[,c(1:5,9,10)]

 

30 characteristic Catalan words for the plane (1,2)

sel.12.BRGW.Cat <- which((res.mfact.23$freq.sup$cos2[c(136:230),1]>0.5)|(res.mfact.23$freq.sup$cos2[c(136:230),2] > 0.5))
sel.12.BRGW.Cat

 

cat(length(sel.12.BRGW.Cat))

Words12.BRGW.Cat <- data.frame(posit=as.vector(sel.12.BRGW.Cat), wordF4=names(sel.12.BRGW.Cat), lang="Cat")
Words12.BRGW.Cat

 

French translation

df.WTR.Cat <- data.frame(orig= "alt", transl="high")
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "bota", transl="barrel") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "cafè", transl="coffee") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "cartró", transl="cardboard") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "cedre", transl="cedar") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "cítric", transl="citrus") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "claudolor", transl="clove") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "cos", transl="full_bodied") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "especiat", transl="spicy") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "floral.1", transl="floral") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "formatge", transl="cheese") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "fruitsec", transl="nuts") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "fum", transl="smoke") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "fusta", transl="wood") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "gerani", transl="geranium") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "glicerol", transl="glycerol") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "greix", transl="fat") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "iode", transl="iodine") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "liniment", transl="liniment") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "malaqualitat", transl="poorquality") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "mantegós", transl="buttered") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "marcat", transl="marked") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "neopre", transl="neoprene") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "regalèssia", transl="licorice") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "secant", transl="drying") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "sutja", transl="soot") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "taní", transl="tannin") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "torrat", transl="toasted") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "vainilla", transl="vanilla") )
df.WTR.Cat <- rbind(df.WTR.Cat , data.frame(orig= "xocolata", transl="chocolate") )
dim(df.WTR.Cat)

df.WTR.Cat

To join Catalan coordinates and their translation. 29 characteristic Catalan words for the plane (1,2):

sel.12.BRGW.Cat

Coord.Cat.Fig4 <- data.frame(res.mfact.23$freq.sup$coord[135+sel.12.BRGW.Cat,], lang="Cat")
Coord.Cat.Fig4 <- merge(Coord.Cat.Fig4, df.WTR.Cat, by.x=0, by.y="orig")
Coord.Cat.Fig4[,c(1:5,9,10)]

 

Coord.Fig4 <- rbind(Coord.Fr.Fig4, Coord.Cat.Fig4)

 

To build Figure 4:

ax1 <-1 ; ax2 <-2
labx <- paste0("Dim 1 (", round(res.mfact.23$eig[ax1,2],1),"%)" )
laby <- paste0("Dim 2 (", round(res.mfact.23$eig[ax2,2],1),"%)" )
font.type.FRCat <- c("bold", "bold.italic")
color.type.FRCat <- c("Green", "Blue")
col.margin = c("black", "red")
Coord.Fig4$lang <- as.factor(Coord.Fig4$lang)
set.seed(1234)
Figure4 <- ggplot(Coord.Fig4)+
theme_light() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
xlab(labx)+ ylab(laby) + coord_fixed()+
geom_hline(yintercept=0, linetype="dashed", color = "grey")+
geom_vline(xintercept=0, linetype="dashed", color = "grey")+
geom_text_repel(size=5, fontface = font.type.FRCat[Coord.Fig4$lang], max.overlaps=100,
box.padding = unit(0.35, "lines"),
aes(x=Dim.1, y=Dim.2, label = transl, color=lang))+
theme( axis.text.x = element_text(size=rel(1.6)))+
theme( axis.text.y = element_text(size=rel(1.6)))+
labs(x=labx)+labs(y=laby)+
theme(axis.title.x= element_text(size=17, face="bold"))+
theme(axis.title.y= element_text(size=17, face="bold"))+
theme(plot.margin = grid::unit(c(t=5,r= 2,b=5, l=2), "mm"))+
scale_color_manual(name="Language",
labels=c("Catalan","French"),
values = setNames(col.margin, levels(Coord.Fig4$lang))) +
theme(axis.title.x = element_text(margin=margin(t=10))) +
theme(panel.border = element_rect(colour = "black", fill=NA, linewidth=1)) +
theme(legend.position = "none")+
labs(title = "Words originally in <b style='color:#FF0000'>**_French_**</b> and **Catalan**")+
theme(plot.title = element_markdown(lineheight = 1.1, hjust=1, size=20))+
ylim(-1.9, 1.1)+
ggtitle("Figure 4. The best-represented global words on either of the first two axes")

 

To plot Figure 4:

set.seed(1234)
Figure4