Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This is a short post presenting the great package semPlot developed by Sacha Epskamp (check out his nice website: http://sachaepskamp.com/) to make nice plots from your SEMs. SEMs are a modelling tool that allow the researcher to investiguate complex relationships between the variables, you may find here many links to free tutorials: http://www.structuralequations.org/. Here I present a few tricks to plot SEMs in R that I have been using but if you look at ?semPaths or ?qgraph you will see that there are many many options to tune your graphs that I will not present here.

``` ```

`````` #loading the library
library(semPlot)
library(lavaan)
library(clusterGeneration) #this is to generate a positive definite covariance matrix
#simulate some data
set.seed(1222)
sig<-genPositiveDefMat("onion",dim=5,eta=4)\$Sigma #the covariance matrix
mus<-c(10,5,120,35,6) #the vector of the means
data<-as.data.frame(mvrnorm(100,mu=mus,Sigma=sig)) #the dataset
names(data)<-c("CO2","Temp","Nitro","Biom","Rich") #giving it some names
#building an SEM with a latent variable
m<-'Abiot =~ CO2 + Temp + Nitro
Biom ~ Abiot
Rich ~ Abiot + Biom'
m.fit<-sem(m,data)
``````
``` #the plot #basic version, the what arguments specify what should be plotted, here we choose to look at the standardized path coefficients semPaths(m.fit,what="std",layout="circle") Here is just a basic version of the plots, many things can be changed, I will focus on the layout of the graph, the labels going into the nodes and the different groups of variables.   #define the label that will go into the nodes lbls<-c("CO2\nconcentration","Temperature","Nitrogen\ncontent","Plant\nbiomass","Plant\nrichness","Abiotic\nenvironment") #define the groups grps<-list(Abiotic=c("CO2","Temp","Nitro","Abiot"),Plant=c("Biom","Rich")) #define the layout ly<-matrix(c(-0.5,-0.5,0,-0.5,0.5,-0.5,0,0.5,-0.5,0.5,0,0),ncol=2,byrow=TRUE) #new plot semPaths(m.fit,what="std",layout=ly,residuals=FALSE,nCharNodes=0,groups=grps,color=c("brown","green"),nodeLabels=lbls,sizeMan=8,posCol=c("blue","red"),edge.label.cex=1.5,legend=FALSE) text(0.9,0.9,labels="Some text about\nthe model or\nthe weather in Indonesia")   In this new plot I used the layout argument to specify my home-made layout, the plot is within a (-1,1)(-1,1) space and the position of each node can be specify using a 2 column matrix containing the X and Y position. To find out the order of the nodes and the edges one can do something like:   semPaths(m.fit,what="std",nodeLabels=letters[1:6],edgeLabels=1:12,edge.label.cex=1.5,fade=FALSE)   Using this knowledge we can define our own node labels using the nodeLabel argument (the \n is to add a line break in the label). Finally the groups argument need a list with character vectors of the different groups, each of the nodes belonging to the groups can get a particular color defined by color. sizeMan control the size of the nodes, posCol the color of the edges, when this is two colors the first one will be used for the positive edges and the second one for the negatives. Again just by looking at the help pages of semPaths you will see much more ways to tailor your graphs to your need. Happy plotting.Filed under: R and Stat Tagged: R, SEMs var vglnk = {key: '949efb41171ac6ec1bf7f206d57e90b8'}; (function(d, t) { var s = d.createElement(t); s.type = 'text/javascript'; s.async = true; // s.defer = true; // s.src = '//cdn.viglink.com/api/vglnk.js'; s.src = 'https://www.r-bloggers.com/wp-content/uploads/2020/08/vglnk.js'; var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r); }(document, 'script')); Related ShareTweet To leave a comment for the author, please follow the link and comment on their blog: biologyforfun » R. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. ```
``` ```
``` ```
``` function init() { var vidDefer = document.getElementsByTagName('iframe'); for (var i=0; i<vidDefer.length; i++) { if(vidDefer[i].getAttribute('data-src')) { vidDefer[i].setAttribute('src',vidDefer[i].getAttribute('data-src')); } } } window.onload = init; R bloggers Facebook page Most viewed posts (weekly) Which data science skills are important (\$50,000 increase in salary in 6-months) PCA vs Autoencoders for Dimensionality Reduction Better Sentiment Analysis with sentiment.ai Self-documenting plots in ggplot2 5 Ways to Subset a Data Frame in R How to write the first for loop in R Markov Chain Introduction in R Sponsors // https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode- // this must be placed higher. Otherwise it doesn't work. // data-cfasync="false" is for making sure cloudflares' rocketcache doesn't interfeare with this // in this case it only works because it was used at the original script in the text widget function createCookie(name,value,days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + value + expires + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } // no longer use async because of google // async async function readTextFile(file) { // Helps people browse between pages without the need to keep downloading the same // ads txt page everytime. This way, it allows them to use their browser's cache. var random_number = readCookie("ad_random_number_cookie"); if(random_number == null) { var random_number = Math.floor(Math.random()*100*(new Date().getTime()/10000000000)); createCookie("ad_random_number_cookie",random_number,1) } file += '?t='+random_number; var rawFile = new XMLHttpRequest(); rawFile.onreadystatechange = function () { if(rawFile.readyState === 4) { if(rawFile.status === 200 || rawFile.status == 0) { // var allText = rawFile.responseText; // document.write(allText); document.write(rawFile.responseText); } } } rawFile.open("GET", file, false); rawFile.send(null); } // readTextFile('https://raw.githubusercontent.com/Raynos/file-store/master/temp.txt'); readTextFile("https://www.r-bloggers.com/wp-content/uploads/text-widget_anti-cache.txt"); Recent Posts Deutschsprachiges Online Shiny Training von eoda How to Calculate a Bootstrap Standard Error in R Dashboards in R Shiny Some R Conferences for 2022 Curating Your Data Science Content on RStudio Connect Adding competing risks in survival data generation measurement units Confidence Intervals Explained The E8 root polytope extinction minus one A zsh Helper Script For Updating macOS RStudio Daily Electron + Quarto CLI Installs Predictive Analytics Models in R repoRter.nih: a convenient R interface to the NIH RePORTER Project API Markov Chain Introduction in R Dual axis charts – how to make them and why they can be useful Jobs for R-usersJunior Data Scientist / Quantitative economistSenior Quantitative AnalystR programmerData Scientist – CGIAR Excellence in Agronomy (Ref No: DDG-R4D/DS/1/CG/EA/06/20)Data Analytics Auditor, Future of Audit Lead @ London or Newcastle python-bloggers.com (python/data-science news)Explaining a Keras _neural_ network predictions with the-tellerObject Oriented Programming in Python – What and Why?Dunn Index for K-Means Clustering EvaluationInstalling Python and Tensorflow with Jupyter Notebook ConfigurationsHow to Get Twitter Data using PythonVisualizations with AltairSpelling Corrector Program in Python Full list of contributing R-bloggers Archives Archives Select Month March 2022  (60) February 2022  (152) January 2022  (155) December 2021  (172) November 2021  (145) October 2021  (199) September 2021  (204) August 2021  (153) July 2021  (172) June 2021  (195) May 2021  (197) April 2021  (183) March 2021  (222) February 2021  (225) January 2021  (252) December 2020  (295) November 2020  (266) October 2020  (276) September 2020  (249) August 2020  (226) July 2020  (268) June 2020  (231) May 2020  (332) April 2020  (326) March 2020  (279) February 2020  (259) January 2020  (250) December 2019  (241) November 2019  (214) October 2019  (230) September 2019  (227) August 2019  (270) July 2019  (258) June 2019  (242) May 2019  (272) April 2019  (289) March 2019  (302) February 2019  (259) January 2019  (282) December 2018  (257) November 2018  (285) October 2018  (298) September 2018  (285) August 2018  (266) July 2018  (327) June 2018  (296) May 2018  (315) April 2018  (296) March 2018  (287) February 2018  (239) January 2018  (328) December 2017  (260) November 2017  (265) October 2017  (287) September 2017  (287) August 2017  (328) July 2017  (279) June 2017  (312) May 2017  (341) April 2017  (319) March 2017  (364) February 2017  (312) January 2017  (364) December 2016  (345) November 2016  (288) October 2016  (298) September 2016  (249) August 2016  (280) July 2016  (322) June 2016  (259) May 2016  (288) April 2016  (258) March 2016  (295) February 2016  (261) January 2016  (334) December 2015  (300) November 2015  (234) October 2015  (255) September 2015  (232) August 2015  (261) July 2015  (240) June 2015  (205) May 2015  (228) April 2015  (203) March 2015  (256) February 2015  (207) January 2015  (237) December 2014  (230) November 2014  (219) October 2014  (212) September 2014  (253) August 2014  (214) July 2014  (226) June 2014  (234) May 2014  (238) April 2014  (256) March 2014  (286) February 2014  (266) January 2014  (260) December 2013  (261) November 2013  (237) October 2013  (233) September 2013  (214) August 2013  (223) July 2013  (254) June 2013  (271) May 2013  (260) April 2013  (278) March 2013  (277) February 2013  (293) January 2013  (340) December 2012  (306) November 2012  (274) October 2012  (304) September 2012  (268) August 2012  (262) July 2012  (247) June 2012  (297) May 2012  (283) April 2012  (295) March 2012  (304) February 2012  (264) January 2012  (278) December 2011  (251) November 2011  (261) October 2011  (280) September 2011  (187) August 2011  (258) July 2011  (219) June 2011  (224) May 2011  (239) April 2011  (267) March 2011  (249) February 2011  (203) January 2011  (209) December 2010  (188) November 2010  (172) October 2010  (219) September 2010  (185) August 2010  (203) July 2010  (175) June 2010  (167) May 2010  (164) April 2010  (152) March 2010  (165) February 2010  (135) January 2010  (121) December 2009  (126) November 2009  (66) October 2009  (87) September 2009  (65) August 2009  (56) July 2009  (64) June 2009  (54) May 2009  (35) April 2009  (38) March 2009  (40) February 2009  (33) January 2009  (42) December 2008  (16) November 2008  (14) October 2008  (10) September 2008  (8) August 2008  (11) July 2008  (7) June 2008  (8) May 2008  (8) April 2008  (4) March 2008  (5) February 2008  (6) January 2008  (10) December 2007  (3) November 2007  (5) October 2007  (9) September 2007  (7) August 2007  (21) July 2007  (9) June 2007  (3) May 2007  (3) April 2007  (1) March 2007  (5) February 2007  (4) November 2006  (1) October 2006  (2) August 2006  (3) July 2006  (1) June 2006  (1) May 2006  (3) April 2006  (1) March 2006  (1) February 2006  (5) January 2006  (1) October 2005  (1) September 2005  (3) May 2005  (1) /* <![CDATA[ */ (function() { var dropdown = document.getElementById( "archives-dropdown-3" ); function onSelectChange() { if ( dropdown.options[ dropdown.selectedIndex ].value !== '' ) { document.location.href = this.options[ this.selectedIndex ].value; } } dropdown.onchange = onSelectChange; })(); /* ]]> */ Other sites Jobs for R-users SAS blogs ```
``` ```
``` Copyright © 2022 | MH Corporate basic by MH Themes ```
``` [{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.r-bloggers.com#Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","sameAs":[],"logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"},"contactPoint":{"@type":"ContactPoint","contactType":"technical support","telephone":"","url":"https:\/\/www.r-bloggers.com\/contact-us\/"}},{"@type":"WebSite","@id":"https:\/\/www.r-bloggers.com#website","headline":"R-bloggers","name":"R-bloggers","description":"R news and tutorials contributed by hundreds of R bloggers","url":"https:\/\/www.r-bloggers.com","potentialAction":{"@type":"SearchAction","target":"https:\/\/www.r-bloggers.com\/?s={search_term_string}","query-input":"required name=search_term_string"},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"}},{"@context":"https:\/\/schema.org","@type":"WebPage","@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#webpage","name":"Ploting SEMs in R using semPlot","url":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/","lastReviewed":"2014-08-10T10:26:54-06:00","dateCreated":"2014-08-10T10:26:54-06:00","inLanguage":"en-US","description":"This is a short post presenting the great package semPlot developed by Sacha Epskamp (check out his nice website: http:\/\/sachaepskamp.com\/) to make nice plots from your SEMs. SEMs are a modelling tool that allow the researcher to investiguate complex relationships between the variables, you may find here many links to free tutorials: http:\/\/www.structuralequations.org\/. Here I ","reviewedBy":{"@type":"Organization","name":"R-bloggers","url":"https:\/\/www.r-bloggers.com","logo":{"@type":"ImageObject","url":"http:\/\/www.r-bloggers.com\/wp-content\/uploads\/2021\/05\/R_blogger_logo1_large.png","width":"1285","height":"369"}},"primaryImageOfPage":{"@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#primaryimage"},"mainContentOfPage":[[{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Home","url":"https:\/\/www.r-bloggers.com"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"About","url":"http:\/\/www.r-bloggers.com\/about\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"RSS","url":"https:\/\/feeds.feedburner.com\/RBloggers"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"add your blog!","url":"http:\/\/www.r-bloggers.com\/add-your-blog\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Learn R","url":"https:\/\/www.r-bloggers.com\/2015\/12\/how-to-learn-r-2\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"R jobs","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Submit a new job (it's free)","url":"https:\/\/www.r-users.com\/submit-job\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Browse latest jobs (also free)","url":"https:\/\/www.r-users.com\/"},{"@context":"https:\/\/schema.org","@type":"SiteNavigationElement","@id":"https:\/\/www.r-bloggers.com\/#top nav","name":"Contact us","url":"http:\/\/www.r-bloggers.com\/contact-us\/"}]],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com#website"},"breadcrumb":{"@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#breadcrumb"}},{"@type":"BreadcrumbList","@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/www.r-bloggers.com","name":"R-bloggers"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/www.r-bloggers.com\/category\/r-bloggers\/","name":"R bloggers"}},{"@type":"ListItem","position":3,"item":{"@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/","name":"Ploting SEMs in R using semPlot"}}]},{"@type":"Article","@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#Article","url":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/","inLanguage":"en-US","mainEntityOfPage":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#webpage","headline":"Ploting SEMs in R using semPlot","description":"This is a short post presenting the great package semPlot developed by Sacha Epskamp (check out his nice website: http:\/\/sachaepskamp.com\/) to make nice plots from your SEMs. SEMs are a modelling tool that allow the researcher to investiguate complex relationships between the variables, you may find here many links to free tutorials: http:\/\/www.structuralequations.org\/. Here I ","articleBody":"This is a short post presenting the great package semPlot developed by Sacha Epskamp (check out his nice website: http:\/\/sachaepskamp.com\/) to make nice plots from your SEMs. SEMs are a modelling tool that allow the researcher to investiguate complex relationships between the variables, you may find here many links to free tutorials: http:\/\/www.structuralequations.org\/. Here I present a few tricks to plot SEMs in R that I have been using but if you look at ?semPaths or ?qgraph you will see that there are many many options to tune your graphs that I will not present here. #loading the library library(semPlot) library(lavaan) library(clusterGeneration) #this is to generate a positive definite covariance matrix #simulate some data set.seed(1222) sig&lt;-genPositiveDefMat(\"onion\",dim5,eta4)\$Sigma #the covariance matrix mus&lt;-c(10,5,120,35,6) #the vector of the means data&lt;-as.data.frame(mvrnorm(100,mumus,Sigmasig)) #the dataset names(data)&lt;-c(\"CO2\",\"Temp\",\"Nitro\",\"Biom\",\"Rich\") #giving it some names #building an SEM with a latent variable m&lt;-'Abiot ~ CO2 + Temp + Nitro Biom ~ Abiot Rich ~ Abiot + Biom' m.fit&lt;-sem(m,data) #the plot #basic version, the what arguments specify what should be plotted, here we choose to look at the standardized path coefficients semPaths(m.fit,what\"std\",layout\"circle\") Here is just a basic version of the plots, many things can be changed, I will focus on the layout of the graph, the labels going into the nodes and the different groups of variables. &nbsp; #define the label that will go into the nodes lbls&lt;-c(\"CO2\\nconcentration\",\"Temperature\",\"Nitrogen\\ncontent\",\"Plant\\nbiomass\",\"Plant\\nrichness\",\"Abiotic\\nenvironment\") #define the groups grps&lt;-list(Abioticc(\"CO2\",\"Temp\",\"Nitro\",\"Abiot\"),Plantc(\"Biom\",\"Rich\")) #define the layout ly&lt;-matrix(c(-0.5,-0.5,0,-0.5,0.5,-0.5,0,0.5,-0.5,0.5,0,0),ncol2,byrowTRUE) #new plot semPaths(m.fit,what\"std\",layoutly,residualsFALSE,nCharNodes0,groupsgrps,colorc(\"brown\",\"green\"),nodeLabelslbls,sizeMan8,posColc(\"blue\",\"red\"),edge.label.cex1.5,legendFALSE) text(0.9,0.9,labels\"Some text about\\nthe model or\\nthe weather in Indonesia\") &nbsp; In this new plot I used the layout argument to specify my home-made layout, the plot is within a (-1,1)(-1,1) space and the position of each node can be specify using a 2 column matrix containing the X and Y position. To find out the order of the nodes and the edges one can do something like: &nbsp; semPaths(m.fit,what\"std\",nodeLabelsletters,edgeLabels1:12,edge.label.cex1.5,fadeFALSE) &nbsp; Using this knowledge we can define our own node labels using the nodeLabel argument (the \\n is to add a line break in the label). Finally the groups argument need a list with character vectors of the different groups, each of the nodes belonging to the groups can get a particular color defined by color. sizeMan control the size of the nodes, posCol the color of the edges, when this is two colors the first one will be used for the positive edges and the second one for the negatives. Again just by looking at the help pages of semPaths you will see much more ways to tailor your graphs to your need. Happy plotting.Filed under: R and Stat Tagged: R, SEMs","keywords":"","datePublished":"2014-08-10T10:26:54-06:00","dateModified":"2014-08-10T10:26:54-06:00","author":{"@type":"Person","name":"grumble10","description":"","url":"https:\/\/www.r-bloggers.com\/author\/grumble10\/","sameAs":["http:\/\/biologyforfun.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/ed235250c11f89cf0e6aa8e167251e53?s=96&d=mm&r=g","height":96,"width":96}},"editor":{"@type":"Person","name":"grumble10","description":"","url":"https:\/\/www.r-bloggers.com\/author\/grumble10\/","sameAs":["http:\/\/biologyforfun.wordpress.com"],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/ed235250c11f89cf0e6aa8e167251e53?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@id":"https:\/\/www.r-bloggers.com#Organization"},"image":[{"@type":"ImageObject","url":"http:\/\/biologyforfun.files.wordpress.com\/2014\/08\/semplot1.png?w=497&#038;h=326","width":497,"height":326,"@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#primaryimage"},{"@type":"ImageObject","url":"http:\/\/biologyforfun.files.wordpress.com\/2014\/08\/semplot21.png?w=497&#038;h=326","width":497,"height":326},{"@type":"ImageObject","url":"http:\/\/biologyforfun.files.wordpress.com\/2014\/08\/semplot3.png?w=497&#038;h=326","width":497,"height":326},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/comments\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/delicious\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/facebook\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/twitter\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/stumble\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/digg\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"https:\/\/feeds.wordpress.com\/1.0\/reddit\/biologyforfun.wordpress.com\/306\/","width":0,"height":0},{"@type":"ImageObject","url":"http:\/\/pixel.wp.com\/b.gif?host=biologyforfun.wordpress.com&#038;blog=42461605&#038;%23038;post=306&#038;%23038;subd=biologyforfun&#038;%23038;ref=&#038;%23038;feed=1","width":1,"height":1}],"isPartOf":{"@id":"https:\/\/www.r-bloggers.com\/2014\/08\/ploting-sems-in-r-using-semplot\/#webpage"}}]}] var snp_f = []; var snp_hostname = new RegExp(location.host); var snp_http = new RegExp("^(http|https)://", "i"); var snp_cookie_prefix = ''; var snp_separate_cookies = false; var snp_ajax_url = 'https://www.r-bloggers.com/wp-admin/admin-ajax.php'; var snp_ajax_nonce = '1def766951'; var snp_ignore_cookies = false; var snp_enable_analytics_events = true; var snp_enable_mobile = false; var snp_use_in_all = false; var snp_excluded_urls = []; Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts. (You will not see this message again.) Click here to close (This popup will not appear again) .snp-pop-109583 .snp-theme6 { max-width: 700px;} .snp-pop-109583 .snp-theme6 h1 {font-size: 17px;} .snp-pop-109583 .snp-theme6 { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field ::-webkit-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-moz-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field :-ms-input-placeholder { color: #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field input { border: 1px solid #a0a4a9;} .snp-pop-109583 .snp-theme6 .snp-field { color: #000000;} .snp-pop-109583 .snp-theme6 { background: #f2f2f2;} jQuery(document).ready(function() { }); var CaptchaCallback = function() { jQuery('.g-recaptcha').each(function(index, el) { grecaptcha.render(el, { 'sitekey' : '' }); }); }; /* <![CDATA[ */!function(e,n){var r={"selectors":{"block":"pre","inline":"code"},"options":{"indent":4,"ampersandCleanup":true,"linehover":true,"rawcodeDbclick":false,"textOverflow":"scroll","linenumbers":false,"theme":"enlighter","language":"r","retainCssClasses":false,"collapse":false,"toolbarOuter":"","toolbarTop":"{BTN_RAW}{BTN_COPY}{BTN_WINDOW}{BTN_WEBSITE}","toolbarBottom":""},"resources":["https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/cache\/enlighterjs.min.css?4WJrVky+dDEQ83W","https:\/\/www.r-bloggers.com\/wp-content\/plugins\/enlighter\/resources\/enlighterjs\/enlighterjs.min.js"]},o=document.getElementsByTagName("head")[0],t=n&&(n.error||n.log)||function(){};e.EnlighterJSINIT=function(){!function(e,n){var r=0,l=null;function c(o){l=o,++r==e.length&&(!0,n(l))}e.forEach(function(e){switch(e.match(/\.([a-z]+)(?:[#?].*)?\$/)[1]){case"js":var n=document.createElement("script");n.onload=function(){c(null)},n.onerror=c,n.src=e,n.async=!0,o.appendChild(n);break;case"css":var r=document.createElement("link");r.onload=function(){c(null)},r.onerror=c,r.rel="stylesheet",r.type="text/css",r.href=e,r.media="all",o.appendChild(r);break;default:t("Error: invalid file extension",e)}})}(r.resources,function(e){e?t("Error: failed to dynamically load EnlighterJS resources!",e):"undefined"!=typeof EnlighterJS?EnlighterJS.init(r.selectors.block,r.selectors.inline,r.options):t("Error: EnlighterJS resources not loaded yet!")})},(document.querySelector(r.selectors.block)||document.querySelector(r.selectors.inline))&&e.EnlighterJSINIT()}(window,console); /* ]]> */ window.FPConfig= { delay: 0, ignoreKeywords: ["\/wp-admin","\/wp-login.php","\/cart","add-to-cart","logout","#","?",".png",".jpeg",".jpg",".gif",".svg"], maxRPS: 3, hoverDelay: 50 }; _stq = window._stq || []; _stq.push([ 'view', {v:'ext',j:'1:7.3.3',blog:'11524731',post:'77741',tz:'-6',srv:'www.r-bloggers.com'} ]); _stq.push([ 'clickTrackerInit', '11524731', '77741' ]); jQuery(document).ready(function (\$) { for (let i = 0; i < document.forms.length; ++i) { let form = document.forms[i]; if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if (\$(form).attr("method") != "get") { \$(form).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } } \$(document).on('submit', 'form', function () { if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="bIDiEKaSr" value="[NwX]avgpyM" />'); } if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="JtlBfjh" value="JlitU.M3" />'); } if (\$(this).attr("method") != "get") { \$(this).append('<input type="hidden" name="BNXYvMTtg" value="m6Py@WO3Y0u" />'); } return true; }); jQuery.ajaxSetup({ beforeSend: function (e, data) { if (data.type !== 'POST') return; if (typeof data.data === 'object' && data.data !== null) { data.data.append("bIDiEKaSr", "[NwX]avgpyM"); data.data.append("JtlBfjh", "JlitU.M3"); data.data.append("BNXYvMTtg", "m6Py@WO3Y0u"); } else { data.data = data.data + '&bIDiEKaSr=[NwX]avgpyM&JtlBfjh=JlitU.M3&BNXYvMTtg=m6Py@WO3Y0u'; } } }); }); ```