background preloader

R

Facebook Twitter

R execution error : object of type 'externalptr' is not subsettable. Externalptr class to character class from (web) scrape. [Rd] Passing externalptr to .C() from Rick Sayre on 2012-05-12 (R devel archive) Greetings. 2.15.0 added this behavior o Passing R objects other than atomic vectors, functions, lists and environments to .C() is now deprecated and will give a warning.

[Rd] Passing externalptr to .C() from Rick Sayre on 2012-05-12 (R devel archive)

Most cases (especially NULL) are actually coding errors. NULL will be disallowed in future. This seems to make sense, except that this case includes externalptrs. I have quite a bit of code, designed to interface with various external hardware devices, which uses this sort of idiom: # for example getDeviceInfo <- function(handle) { .C("groovyDevice_getDeviceInfo", PACKAGE="groovyDevice", handle, status = as.integer(0))[-1] # skip handle where "handle" was the result of a .Call to a routine which returned a SEXP which was the result of a R_MakeExternalPtr() call The "c" routine looked like: void groovyDevice_getDeviceInfo(SEXP handle, int *status) { R: Print list to a text file. 'externalptr' error in R using XML data. [Rd] why is class externalptr considered recursive? [Rd] why is class externalptr considered recursive?

[Rd] why is class externalptr considered recursive?

William Dunlap wdunlap at tibco.com Fri Jan 14 02:14:05 CET 2011. Jtprince/rserve-simpler. Turing completeness. In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing complete or computationally universal if it can be used to simulate any single-taped Turing machine.

Turing completeness

The concept is named after Alan Turing. A classic example is lambda calculus. Computability theory includes the closely related concept of Turing equivalence. Two computers P and Q are called Turing equivalent if P can simulate Q and Q can simulate P. Thus, a Turing-complete system is one that can simulate a Turing machine; and, per the Church–Turing thesis, that any real-world computer can be simulated by a Turing machine, it is Turing equivalent to a Turing machine.

In colloquial usage, the terms "Turing complete" or "Turing equivalent" are used to mean that any real-world general-purpose computer or computer language can approximately simulate any other real-world general-purpose computer or computer language. S (programming language) S is one of several statistical computing languages that were designed at Bell Laboratories, and first took form between 1975–1976.

S (programming language)

Up to that time, much of the statistical computing was done by directly calling Fortran subroutines; however, S was designed to offer an alternate and more interactive approach. Early design decisions that hold even today include interactive graphics devices (printers and character terminals at the time), and providing easily accessible documentation for the functions. When UNIX/32V was ported to the (then new) 32-bit DEC VAX, computing on the Unix platform became feasible for S. In late 1979, S was ported from GCOS to UNIX, which would become the new primary platform. In 1980, the first version of S distributed outside of Bell Laboratories, and in 1981, source version were made available.

Version 4 of S, often abbreviated S4, provides advanced object-oriented features. RSRuby and Rails revisited. A couple of months ago, I wrote a brief guide to displaying R plots in a Rails application using RSRuby.

RSRuby and Rails revisited

It worked at the time – really it did – but since then, I’ve encountered problems. One is that despite sending the plot output to a PNG file, R X11 windows started to pop up on loading the web page containing the plot. Another is the appearance of long error messages related to “stack smashing” on terminating Mongrel server. Fortunately, I read an excellent guide by Ana Nelson, R on Rails with RSRuby, which convinced me that I was doing things all wrong. Baby steps with RSRuby in Rails. Plotting and charting libraries for Ruby (on Rails) abound.

Baby steps with RSRuby in Rails

However, few are sophisticated enough for scientists and many are not actively maintained. Plotting in R, on the other hand, is about as sophisticated as it comes. Can we bridge Ruby and R? Alexgutteridge/rsruby. 9.7 Data import/export. Subsections Almost all of the examples so far have used data that are typed explicitly as R expressions.

9.7 Data import/export

In practice, data usually reside in one or more files of various formats and in some form of mass storage. This section looks at R functions that can be used to read data into R from such external files. We will look at functions that deal with all of the different data storage options that were discussed in Chapter 5: plain text files, XML documents, binary files, spreadsheets, and databases. We will also look at some functions that go the other way and write a data structure from RAM to external mass storage. 9.7.1 The working directory This section provides a little more information about how the R software environment works, with respect to reading and writing files.

Any files created during an R session are created in the current working directory of the session, unless an explicit path or folder or directory is specified. The XML Package. R Data Import/Export. Table of Contents This is a guide to importing and exporting data to and from R.

R Data Import/Export

This manual is for R, version 3.1.0 (2014-04-10). Copyright © 2000–2013 R Core Team Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Acknowledgements The relational databases part of this manual is based in part on an earlier manual by Douglas Bates and Saikat DebRoy. Many volunteers have contributed to the packages used here. Brian Ripley is the author of the support for connections. 1 Introduction. R Programming.