Set Up

Library loading

library(ade4)
library(adegraphics)
## 
## Attaching package: 'adegraphics'
## 
## The following objects are masked from 'package:ade4':
## 
##     kplotsepan.coa, s.arrow, s.class, s.corcircle, s.distri,
##     s.image, s.label, s.logo, s.match, s.traject, s.value,
##     table.value, triangle.class
library(dplyr)
## 
## Attaching package: 'dplyr'
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)
library(grid)

Data input

dip <- read.csv("~/Desktop/dip.csv")
cs <- read.csv("~/Desktop/cs.csv")

Data management with dplyr

cs68 <- filter(cs, wave=="1968")
cs75 <- filter(cs, wave=="1975")
cs82 <- filter(cs, wave=="1982")
cs90 <- filter(cs, wave=="1990")
cs99 <- filter(cs, wave=="1999")
cs06 <- filter(cs, wave=="2006")
cs11 <- filter(cs, wave=="2011")
cs68 <- select(cs68, p_cs1:p_cs6)
cs75 <- select(cs75, p_cs1:p_cs6)
cs82 <- select(cs82, p_cs1:p_cs6)
cs90 <- select(cs90, p_cs1:p_cs6)
cs99 <- select(cs99, p_cs1:p_cs6)
cs06 <- select(cs06, p_cs1:p_cs6)
cs11 <- select(cs11, p_cs1:p_cs6)
dip68 <- filter(dip, wave=="1968")
dip75 <- filter(dip, wave=="1975")
dip82 <- filter(dip, wave=="1982")
dip90 <- filter(dip, wave=="1990")
dip99 <- filter(dip, wave=="1999")
dip06 <- filter(dip, wave=="2006")
dip11 <- filter(dip, wave=="2011")
dip68 <- select(dip68, p_dip0:p_dip7)
dip75 <- select(dip75, p_dip0:p_dip7)
dip82 <- select(dip82, p_dip0:p_dip7)
dip90 <- select(dip90, p_dip0:p_dip7)
dip99 <- select(dip99, p_dip0:p_dip7)
dip06 <- select(dip06, p_dip0:p_dip7)
dip11 <- select(dip11, p_dip0:p_dip7)

K-Tables analysis

Centering data frames

wcs68 <- data.frame(scalewt(cs68))
wcs75 <- data.frame(scalewt(cs75))
wcs82 <- data.frame(scalewt(cs82))
wcs90 <- data.frame(scalewt(cs90))
wcs99 <- data.frame(scalewt(cs99))
wcs06 <- data.frame(scalewt(cs06))
wcs11 <- data.frame(scalewt(cs11))

Listing dataframes to produce a K-tables object

lwcs <- list(wcs68, wcs75, wcs82, wcs90, wcs99, wcs06, wcs11)
kwcs <- ktab.list.df(lwcs)

Partial Triadic Analysis

ptawcs <- pta(kwcs, scannf = FALSE, nf=2)
plot(ptawcs)

Multiple Co-Inertia Analysis

mcoawcs <- mcoa(kwcs, scannf = FALSE, nf = 2)
plot(mcoawcs)