R/map_mfa.R

Defines functions map.with.mfa

# map with MFA

map.with.mfa=function(X,Y,axis){
  data.mfa=cbind.data.frame(X,Y)
  res.mfa=MFA(data.mfa,group=c(ncol(X),ncol(Y)),ncp=max(axis),
              type=rep("s",2),name.group = c("Sensory","Hedonic"), graph=FALSE)
  senso.select=grep(".Sensory",rownames(res.mfa$ind$coord.partiel))
  coord.partial=res.mfa$ind$coord.partiel[senso.select,1:2]
  rownames(coord.partial)=rownames(Y)
  F1=coord.partial[,axis[1]]
  F2=coord.partial[,axis[2]]
  map=cbind(F1,F2,Y)
  return(list(F1=F1,F2=F2,map=map))
}

Try the SensMap package in your browser

Any scripts or data that you put into this service are public.

SensMap documentation built on July 5, 2022, 1:09 a.m.