{"id":2922,"date":"2013-10-23T12:32:00","date_gmt":"2013-10-23T11:32:00","guid":{"rendered":"https:\/\/abcdr.guyader.pro\/?p=2922"},"modified":"2018-04-08T00:01:08","modified_gmt":"2018-04-07T23:01:08","slug":"quelle-est-la-difference-entre-library-et-require","status":"publish","type":"post","link":"https:\/\/thinkr.fr\/abcdr\/quelle-est-la-difference-entre-library-et-require\/","title":{"rendered":"quelle est la diff\u00e9rence entre library et require ?"},"content":{"rendered":"<p>Il n &lsquo;y en a pas&#8230;ou si peu. La seule diff\u00e9rence est que require est a utiliser dans le corps d &lsquo;une fonction , qui affichera un message d&rsquo;erreur si le package n&rsquo;existe pas mais continuera son execution<\/p>\n<pre><code><br \/><br \/>mafunc&lt;-function(a){<br \/><br \/>require(bidul)<br \/>print(a)<br \/>}<br \/><br \/><br \/>mafunc2&lt;-function(a){<br \/><br \/>library(bidul)<br \/>print(a)<br \/>}<br \/>mafunc(\"coucou\")<br \/>mafunc2(\"coucou\")<br \/><br \/> <br \/> <\/code><\/pre>\n<p> require peut ausi etre utilis\u00e9 pour tester l&rsquo;existence d&rsquo;un package puique qu&rsquo;il va retourner TRUE ou FALSE alors que library ne renvoie rien<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Il n &lsquo;y en a pas&#8230;ou si peu. La seule diff\u00e9rence est que require est a utiliser dans le corps d &lsquo;une fonction , qui affichera un message d&rsquo;erreur si le package n&rsquo;existe pas mais continuera son execution mafunc&lt;-function(a){require(bidul)print(a)}mafunc2&lt;-function(a){library(bidul)print(a)}mafunc(\u00ab\u00a0coucou\u00a0\u00bb)mafunc2(\u00ab\u00a0coucou\u00a0\u00bb) require peut ausi etre utilis\u00e9 pour tester l&rsquo;existence d&rsquo;un package puique qu&rsquo;il va retourner TRUE ou FALSE alors que library ne renvoie rien<a class=\"more-link\" href=\"https:\/\/thinkr.fr\/abcdr\/quelle-est-la-difference-entre-library-et-require\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"twitter_399453572_399453572":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-vincent","4":"post-2922","6":"format-standard","7":"category-message-derreur"},"acf":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p9O7Sx-L8","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/2922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/comments?post=2922"}],"version-history":[{"count":2,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/2922\/revisions"}],"predecessor-version":[{"id":4236,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/posts\/2922\/revisions\/4236"}],"wp:attachment":[{"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/media?parent=2922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/categories?post=2922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkr.fr\/abcdr\/wp-json\/wp\/v2\/tags?post=2922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}