'cogmapr' is an R-package that aims (i) to generated cognitive maps based on the coding of qualitative documents and (ii) to help researchers to analyse these cognitive maps. This approach was firstly developed for analysing systems of pratices in social-ecological systems (CMASOP1), but can be useful for qualitative analyses.
'cogmapr' is the core of a series of three R-packages that works together :
'qcoder', particularilly, the forked version developped for cognitive mapping
'cogmapr', all r-base functions for building and analysing cognitive maps (exporting, plots, quotes, documents, …)
'cogmapvisualizr', a shiny app that makes the usage of
This user’s manual covers the usage of these three tools. A first section is devoted to the installation of them and the second section to their usage.
The package is hosted on Github and can be installed using the
devtools::install_github('FrdVnW/qcoder', ref = "cogmap-dev", upgrade = 'never')
‘cogmapr’ depend on
'Rgraphviz', two packages that are not available on CRAN but hosted on ‘Bioconductor’.
cogmapr package is available on CRAN.
The development branches and previous releases are hosted on Gitlab and can be installed in
R using ‘devtools’. These can be installed as follow.
devtools::install_git("https://gitlab.com/FrdVnW/cogmapr", branch = "dev", upgrade = 'never') devtools::install_git("https://gitlab.com/FrdVnW/cogmapr", branch = "RELEASE_0.9.1", upgrade = 'never')
Creation of a new project
create_qcoder_cogmap_project("PROJECT_NAME", sample = TRUE)
This command will set up a new repository, which is a folder ‘PROJECTNAME’ and a series of important subfolders. If
sample = TRUE=, basic examples files are copied in the subfolders (4 documents, a small concepts list and some units informations).
Before the import, optionnally :
'concepts.csv'file in the folder ‘concepts’ 3
Importing the main parameters will initiate the data frames, in the data frames subfolders.
BE CAREFUL ! Do not import project data if you have already coded your documents or a part of them !
Some project variables
Three variables have to be defined before launching the application. These variables can be adapted/changed each time the project is launched (but this is not recommanded).
Launch the application
If you already started your projects and coded your documents, you can start here.
This will serve a shiny application reachable locally (127.0.0.1).
Coding the documents
For coding your documents using qcoder, we proposed a small screencast.
The ‘cogmapr’ package contains functions that can be used for plotting cognitive maps using scripts and terminal. Both base plot and ggplot2 outputs are proposed.
'PROJECT_NAME' is a project made by the
'qcoder' package, using the
'cogmap' way, as descibed here above. The main path is the path in your computer where this project is stored, (terminating by “/”). By default, it is assumed to be in the working directory of your R session.
project_name <- "PROJECT_NAME" main_path <- paste0(getwd(),'/') my.cogmap.project <- ProjectCMap(main_path,project_name)
The following commands or group of commands generate, in this order :
a plot, the social cognitive map (SCM) of all documents, but selecting the relationship with a minimum weight of 2.
plot(IndCMap(my.cogmap.project, doc.id = ‘1’))
plot( SocCMap( EdgSocCMap(my.cogmap.project, min.weight = 2 ), my.cogmap.project, label=“name” ) )
These functions may need a LaTeX installation on your computer (to be enhanced, maybe adding other formats).
SheetCoding(my.cogmap.project) ## ReportICM(my.cogmap.project) ## bug ## ReportSCM(my.cogmap.project) ## bug
Frédéric M Vanwindekens, Didier Stilmant, and Philippe V Baret. Development of a broadened cognitive mapping approach for analysing systems of practices in social–ecological systems. Ecological modelling, 250:352–362, 2013.
Frédéric M Vanwindekens, Philippe V Baret, and Didier Stilmant. A new approach for comparing and categorizing farmers’ systems of practice based on cognitive mapping and graph theory indicators. Ecological Modelling, 274:1–11, 2014.
Frédéric M Vanwindekens, Didier Stilmant, and Philippe V Baret. Using R in transdisciplinary approches for visualiazing and analysing people’s perceptions, knowledge and practices in complex social-ecological systems. In The R User Conference, useR! 2017 July 4-7 2017 Brussels, Belgium, page 251, 2017.
1 Vanwindekens et al., 2013
2 The CMASOP approach was initially developped using RQDA. This package is no longer maintained and not supported on newer systems (R, linux…). It depends on linux packages
gWidgetsRGtk2. If you really want to use RQDA again, we developped a docker image that can be used at this usage : https://gitlab.com/FrdVnW/dockerqda (info in the readme file).