{"id":22628,"date":"2023-02-28T02:06:11","date_gmt":"2023-02-28T02:06:11","guid":{"rendered":"https:\/\/www.booksofall.com\/es\/?post_type=product&#038;p=22628"},"modified":"2023-02-28T02:06:12","modified_gmt":"2023-02-28T02:06:12","slug":"writing-r-extensions","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/","title":{"rendered":"Writing R Extensions"},"content":{"rendered":"<p>Packages provide a mechanism for loading <a href=\"https:\/\/sites.google.com\/site\/philologic3\/wiki\/useful-links\/optional-code\">optional code<\/a>, data and documentation as needed. The<a href=\"https:\/\/www.r-project.org\/\"> R<\/a> distribution itself includes about 30 packages.<\/p>\n<p>In the following, we assume that you know the library() command, including its lib.loc argument, and we also assume basic knowledge of the R CMD INSTALL utility. Otherwise, please look at R\u2019s help pages on<\/p>\n<p>?library<\/p>\n<p>?INSTALL<\/p>\n<p>before reading on.<\/p>\n<p>For packages which contain code to be compiled, a computing environment including a number of tools is assumed; the \u201c<a href=\"https:\/\/cran.r-project.org\/doc\/manuals\/r-release\/R-admin.html\">R Installation and Administration<\/a>\u201d manual describes what is needed for each OS.<\/p>\n<p>Once a source package is created, it must be installed by the command R CMD INSTALL. See Section \u201cAdd-on-packages\u201d in R Installation and Administration.<\/p>\n<p>Other types of extensions are supported (but rare): See Section 1.10 [Package types], page 75.<\/p>\n<p>Some notes on terminology complete this introduction. These will help with the reading of this manual, and also in describing concepts accurately when asking for help.<\/p>\n<p>A package is a directory of files which extend R, a source package (the master files of a package), or a tarball containing the files of a source package, or an installed package, the result of running<a href=\"https:\/\/www.rdocumentation.org\/packages\/utils\/versions\/3.6.2\/topics\/INSTALL\"> R CMD INSTALL<\/a> on a source package. On some platforms (notably macOS and Windows) there are also binary packages, a zip file or tarball containing the files of an installed package which can be unpacked rather than installing from sources.<\/p>\n<p>A package is not1 a library. The latter is used in two senses in R documentation.<\/p>\n<p>\u2022 A directory into which packages are installed, e.g. \/usr\/lib\/R\/library: in that sense it is sometimes referred to as a library directory or library tree (since the library is a directory which contains packages as directories, which themselves contain directories).<\/p>\n<p>\u2022 That used by the operating system, as a shared, dynamic or static library or (especially on Windows) a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Dynamic-link_library\">DLL<\/a>, where the second <a href=\"http:\/\/l-lang.org\/\">L<\/a> stands for \u2018library\u2019. Installed packages may contain compiled code in what is known on <a href=\"https:\/\/en.wikipedia.org\/wiki\/Unix-like#:~:text=Some%20well%2Dknown%20examples%20of,used%20on%20Unix%2Dlike%20systems.\">Unix-alikes<\/a> as a shared object and on Windows as a DLL. The concept of a shared library (dynamic library on macOS) as a collection of compiled code to which a package might link is also used, especially for R itself on some platforms. On most platforms these concepts are interchangeable (shared objects and DLLs can both be loaded into the R process and be linked against), but macOS distinguishes between shared objects (extension .so) and dynamic libraries (extension .dylib).<\/p>\n<p>There are a number of well-defined operations on source packages.<\/p>\n<p>\u2022 The most common is installation which takes a source package and installs it in a library using R CMD INSTALL or install.packages.<\/p>\n<p>\u2022 Source packages can be built. This involves taking a source directory and creating a tarball ready for distribution, including cleaning it up and creating PDF documentation from any vignettes it may contain. Source packages (and most often tarballs) can be checked, when a test installation is done and tested (including running its examples); also, the contents of the package are tested in various ways for consistency and portability.<\/p>\n<p>\u2022 Compilation is not a correct term for a package. Installing a source package which contains C, C++ or Fortran code will involve compiling that code. There is also the possibility of \u2018byte\u2019 compiling the R code in a package (using the facilities of package compiler): nowadays<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 700px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/r-admin-19ti44fi7d?enforceShowPromotionBar=true&amp;p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":22642,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":""},"product_brand":[],"product_cat":[367],"product_tag":[],"class_list":{"0":"post-22628","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-r","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Writing R Extensions - BooksOfAll Spanish<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Writing R Extensions - BooksOfAll Spanish\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Spanish\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-28T02:06:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png\" \/>\n<meta name=\"twitter:label1\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/\",\"url\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/\",\"name\":\"Writing R Extensions - BooksOfAll Spanish\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png\",\"datePublished\":\"2023-02-28T02:06:11+00:00\",\"dateModified\":\"2023-02-28T02:06:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png\",\"width\":\"545\",\"height\":\"741\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/es\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Writing R Extensions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/es\/#website\",\"url\":\"https:\/\/www.booksofall.com\/es\/\",\"name\":\"BooksOfAll Spanish\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/es\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/es\/#organization\",\"name\":\"BooksOfAll Spanish\",\"url\":\"https:\/\/www.booksofall.com\/es\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/www.booksofall.com\/es\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Spanish\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/es\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Writing R Extensions - BooksOfAll Spanish","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:\/\/www.booksofall.com\/es\/writing-r-extensions\/","og_locale":"es_ES","og_type":"article","og_title":"Writing R Extensions - BooksOfAll Spanish","og_url":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/","og_site_name":"BooksOfAll Spanish","article_modified_time":"2023-02-28T02:06:12+00:00","og_image":[{"url":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png","twitter_misc":{"Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/","url":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/","name":"Writing R Extensions - BooksOfAll Spanish","isPartOf":{"@id":"https:\/\/www.booksofall.com\/es\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png","datePublished":"2023-02-28T02:06:11+00:00","dateModified":"2023-02-28T02:06:12+00:00","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/es\/writing-r-extensions\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#primaryimage","url":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png","contentUrl":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2023\/02\/img_63fd5bea738ba.png","width":"545","height":"741"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/es\/writing-r-extensions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/es\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/es\/categories\/"},{"@type":"ListItem","position":3,"name":"Writing R Extensions"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/es\/#website","url":"https:\/\/www.booksofall.com\/es\/","name":"BooksOfAll Spanish","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/es\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/es\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/es\/#organization","name":"BooksOfAll Spanish","url":"https:\/\/www.booksofall.com\/es\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/www.booksofall.com\/es\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/es\/wp-content\/uploads\/sites\/5\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Spanish"},"image":{"@id":"https:\/\/www.booksofall.com\/es\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/product\/22628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/media\/22642"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/media?parent=22628"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/product_brand?post=22628"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/product_cat?post=22628"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/es\/wp-json\/wp\/v2\/product_tag?post=22628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}