<br />
<b>Warning</b>:  Undefined variable $num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>126</b><br />
<br />
<b>Warning</b>:  Undefined variable $posts_num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>127</b><br />
<br />
<b>Warning</b>:  Undefined variable $num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>126</b><br />
<br />
<b>Warning</b>:  Undefined variable $posts_num in <b>/home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php</b> on line <b>127</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php:126) in <b>/home/shroutdo/public_html/courses/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1902</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/shroutdo/public_html/courses/wp-content/plugins/single-categories/single_categories.php:126) in <b>/home/shroutdo/public_html/courses/wp-includes/rest-api/class-wp-rest-server.php</b> on line <b>1902</b><br />
{"id":807,"date":"2018-11-13T14:52:27","date_gmt":"2018-11-13T14:52:27","guid":{"rendered":"http:\/\/courses.shroutdocs.org\/dcs104-fall2018\/?p=807"},"modified":"2018-11-13T14:52:27","modified_gmt":"2018-11-13T14:52:27","slug":"code-to-check-if-packages-are-installed-run-if-not","status":"publish","type":"post","link":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/2018\/11\/13\/code-to-check-if-packages-are-installed-run-if-not\/","title":{"rendered":"Code to check if packages are installed, run if not"},"content":{"rendered":"<p>Hello all,<\/p>\n<p>We can certainly run each package at the start of each notebook, but if you are comfortable, you can also use the following code:<\/p>\n<pre># List your packages here (this checks to see if tidyRSS and stringr are installed.\r\npackages &lt;- c(\"tidyRSS\", \"stringr\")\r\n\r\n# Run this without making changes\r\npackage.check &lt;- lapply(packages, FUN = function(x) {\r\n  if (!require(x, character.only = TRUE)) {\r\n    install.packages(x, dependencies = TRUE)\r\n    library(x, character.only = TRUE)\r\n  }\r\n})<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Hello all, We can certainly run each package at the start of each notebook, but if you are comfortable, you can also use the following code: # List your packages here (this checks to see if tidyRSS and stringr are installed. packages &lt;- c(&#8220;tidyRSS&#8221;, &#8220;stringr&#8221;) # Run this without making changes package.check &lt;- lapply(packages, FUN&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-807","post","type-post","status-publish","format-standard","hentry","category-admin-and-announcements"],"_links":{"self":[{"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/posts\/807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/comments?post=807"}],"version-history":[{"count":1,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/posts\/807\/revisions"}],"predecessor-version":[{"id":808,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/posts\/807\/revisions\/808"}],"wp:attachment":[{"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/media?parent=807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/categories?post=807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.shroutdocs.org\/dcs104-fall2018\/wp-json\/wp\/v2\/tags?post=807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}