Overview R’s built-in copy-on-modify behavior prevents the user from having two symbols always pointing to the same object. Because pointers, as they are common in other programming languages, are essentially symbols (variables) related to an object that has already another symbol attached to it, it is clear that pointers do not fit naturally into R’s language concept. However, pointers would be indredibly useful, e.g. when you work with complex subsets of dataframes. These complex filtering conditions make the code harder to read and to maintain. For this reason, it would be good to have a kind of ‘abbreviation’ or ‘shortcut’ that lets you write such filtering conditions more efficiently. Thepointr package provides functionality to create pointers to any R object easily, including pointers to subsets/selections from dataframes. Working with pointr Installing and loading pointr To install the CRAN version of pointr from the R console, just call: install.packages( "
Popular posts from this blog
Usually it is easier to work with data when you have them in a tabular, relational format. Often enough however, we only get the data in an object-oriented, NoSQL data format like XML or JSON. So there is a need to transform NoSQL data to something that is easier to work with. This is where my new package xml2relational comes into play. What xml2relational does xml2relational is designed to convert XML documents with nested object hierarchies into a set of R dataframes. These dataframes represent the different tables in a relational data model and are connected amongst each other by foreign keys. Essentially, xml2relational flattens an object-oriented data structure into a relational data structure. Once the relational structure is created (and that is basically a list of dataframes representing the different tables) you can export both the data model (as SQL CREATE statements) and the data (either as SQL INSERT statements or as CSV files) to get the data easily into a rel