{"id":1915,"date":"2023-07-24T11:42:05","date_gmt":"2023-07-24T11:42:05","guid":{"rendered":"https:\/\/statorials.org\/it\/per-funzione-in-r\/"},"modified":"2023-07-24T11:42:05","modified_gmt":"2023-07-24T11:42:05","slug":"per-funzione-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/it\/per-funzione-in-r\/","title":{"rendered":"Come utilizzare la funzione par() in r"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u00c8 possibile utilizzare la funzione <strong>par()<\/strong> in R per creare pi\u00f9 grafici contemporaneamente.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Questa funzione utilizza la seguente sintassi di base:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define plot area as four rows and two columns<\/span>\nby(mfrow = c(4, 2))    \n\n<span style=\"color: #008080;\">#create plots\n<\/span>plot(1:5)\nplot(1:20)\n...<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">I seguenti esempi mostrano come utilizzare questa funzione nella pratica.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Esempio 1: visualizza pi\u00f9 grafici con par()<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come utilizzare la funzione <strong>par()<\/strong> per definire un&#8217;area del tracciato con 3 righe e 1 colonna:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define plot area as three rows and one column<\/span>\nby(mfrow = c(3, 1))    \n\n<span style=\"color: #008080;\">#create plots\n<span style=\"color: #000000;\">plot(1:5, pch=19, col=' <span style=\"color: #ff0000;\">red<\/span> ')\nplot(1:10, pch=19, col=' <span style=\"color: #ff0000;\">blue<\/span> ')\nplot(1:20, pch=19, col=' <span style=\"color: #ff0000;\">green<\/span> ')\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18291\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/par1-1.png\" alt=\"funzione di in r\" width=\"608\" height=\"527\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Esempio 2: specificare i margini del percorso con mar()<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come utilizzare l&#8217;argomento <strong>mar()<\/strong> per specificare i margini attorno a ciascun percorso nel seguente ordine: inferiore, sinistro, superiore, destra.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Nota:<\/strong> l&#8217;impostazione predefinita \u00e8 mar = c(5.1, 4.1, 4.1, 2.1)<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define plot area with tiny bottom margin and huge right margin<\/span>\npar(mfrow = c(3, 1), mar = c(0.5, 4, 4, 20))    \n\n<span style=\"color: #008080;\">#create plots\n<span style=\"color: #000000;\">plot(1:5, pch=19, col=' <span style=\"color: #ff0000;\">red<\/span> ')\nplot(1:10, pch=19, col=' <span style=\"color: #ff0000;\">blue<\/span> ')\nplot(1:20, pch=19, col=' <span style=\"color: #ff0000;\">green<\/span> ')<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18292\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/par2-1.png\" alt=\"funzione di mar in R\" width=\"507\" height=\"594\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Nota come i percorsi appaiono pi\u00f9 stretti perch\u00e9 abbiamo reso il margine destro cos\u00ec grande.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Esempio 3: specificare la dimensione del testo dei grafici con cex()<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Il codice seguente mostra come utilizzare gli argomenti <strong>cex.lab()<\/strong> e <strong>cex.axis()<\/strong> per specificare rispettivamente la dimensione delle etichette degli assi e delle etichette dei segni di spunta.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Nota:<\/strong> l&#8217;impostazione predefinita \u00e8 cex.lab = 1 e cex.axis = 1<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define plot area with large axis labels<\/span>\npar(mfrow = c(3, 1), mar = c(5, 10, 4, 1), cex. <span style=\"color: #3366ff;\">axis<\/span> = 3, cex. <span style=\"color: #3366ff;\">lab<\/span> = 3)    \n\n<span style=\"color: #008080;\">#create plots\n<span style=\"color: #000000;\">plot(1:5, pch=19, col=' <span style=\"color: #ff0000;\">red<\/span> ')\nplot(1:10, pch=19, col=' <span style=\"color: #ff0000;\">blue<\/span> ')\nplot(1:20, pch=19, col=' <span style=\"color: #ff0000;\">green<\/span> ')<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-18294 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/par3-1.png\" alt=\"\" width=\"532\" height=\"476\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Una volta finito di utilizzare la funzione par(), puoi utilizzare la funzione <strong>dev.off()<\/strong> per reimpostare le opzioni par.<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#reset by() options\n<\/span>dev. <span style=\"color: #3366ff;\">off<\/span> ()<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u00c8 una buona cosa usare <strong>dev.off()<\/strong> ogni volta che finisci di usare la funzione par().<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Risorse addizionali<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/it\/tracciare-piu-colonne-in-r\/\" target=\"_blank\" rel=\"noopener\">Come tracciare pi\u00f9 colonne in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/legenda-fuori-trama-r\/\" target=\"_blank\" rel=\"noopener\">Come disegnare una leggenda al di fuori di una trama in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/it\/log-log-grafico-in-r\/\" target=\"_blank\" rel=\"noopener\">Come creare un grafico log-log in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c8 possibile utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente. Questa funzione utilizza la seguente sintassi di base: #define plot area as four rows and two columns by(mfrow = c(4, 2)) #create plots plot(1:5) plot(1:20) &#8230; I seguenti esempi mostrano come utilizzare questa funzione nella pratica. Esempio 1: visualizza pi\u00f9 grafici con [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Come utilizzare la funzione par() in R - Stology<\/title>\n<meta name=\"description\" content=\"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/it\/per-funzione-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Come utilizzare la funzione par() in R - Stology\" \/>\n<meta property=\"og:description\" content=\"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/it\/per-funzione-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-24T11:42:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/par1-1.png\" \/>\n<meta name=\"author\" content=\"Benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/it\/per-funzione-in-r\/\",\"url\":\"https:\/\/statorials.org\/it\/per-funzione-in-r\/\",\"name\":\"Come utilizzare la funzione par() in R - Stology\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/it\/#website\"},\"datePublished\":\"2023-07-24T11:42:05+00:00\",\"dateModified\":\"2023-07-24T11:42:05+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\"},\"description\":\"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/it\/per-funzione-in-r\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/it\/per-funzione-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/it\/per-funzione-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Casa\",\"item\":\"https:\/\/statorials.org\/it\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Come utilizzare la funzione par() in r\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/it\/#website\",\"url\":\"https:\/\/statorials.org\/it\/\",\"name\":\"Statorials\",\"description\":\"La tua guida all&#039;alfabetizzazione statistica!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/it\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae\",\"name\":\"Benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Benjamin anderson\"},\"description\":\"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9\",\"sameAs\":[\"https:\/\/statorials.org\/it\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Come utilizzare la funzione par() in R - Stology","description":"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/it\/per-funzione-in-r\/","og_locale":"it_IT","og_type":"article","og_title":"Come utilizzare la funzione par() in R - Stology","og_description":"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.","og_url":"https:\/\/statorials.org\/it\/per-funzione-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-24T11:42:05+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/par1-1.png"}],"author":"Benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Benjamin anderson","Est. reading time":"2 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/it\/per-funzione-in-r\/","url":"https:\/\/statorials.org\/it\/per-funzione-in-r\/","name":"Come utilizzare la funzione par() in R - Stology","isPartOf":{"@id":"https:\/\/statorials.org\/it\/#website"},"datePublished":"2023-07-24T11:42:05+00:00","dateModified":"2023-07-24T11:42:05+00:00","author":{"@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae"},"description":"Questo tutorial spiega come utilizzare la funzione par() in R per creare pi\u00f9 grafici contemporaneamente.","breadcrumb":{"@id":"https:\/\/statorials.org\/it\/per-funzione-in-r\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/it\/per-funzione-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/it\/per-funzione-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Casa","item":"https:\/\/statorials.org\/it\/"},{"@type":"ListItem","position":2,"name":"Come utilizzare la funzione par() in r"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/it\/#website","url":"https:\/\/statorials.org\/it\/","name":"Statorials","description":"La tua guida all&#039;alfabetizzazione statistica!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/it\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"it-IT"},{"@type":"Person","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/0896f191fb9fb019f2cd8623112cb3ae","name":"Benjamin anderson","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/statorials.org\/it\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/it\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Benjamin anderson"},"description":"Ciao, sono Benjamin, un professore di statistica in pensione diventato insegnante dedicato di Statorials. Con una vasta esperienza e competenza nel campo della statistica, sono ansioso di condividere le mie conoscenze per potenziare gli studenti attraverso Statorials. Scopri di pi\u00f9","sameAs":["https:\/\/statorials.org\/it"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/1915"}],"collection":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/posts\/1915\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/media?parent=1915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/categories?post=1915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/it\/wp-json\/wp\/v2\/tags?post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}