$ R CMD SHLIB size.c
$ Rscript -e "dyn.load('size.so'); siz <- function(.) .Call( 'siz', .) ; siz(1:10); siz(siz); siz(letters) "
[1] 88
[1] 600
[1] 1496
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The code below will probably only work on Linux and requires VLC on the path. | |
library(beepr) | |
library(stringr) | |
play_vlc <- function(fname) { | |
system(paste("open -a vlc --args --no-loop --no-repeat --playlist-autostart --no-media-library", fname), | |
ignore.stdout = TRUE, ignore.stderr=TRUE,wait = FALSE) | |
} | |
# Plays the mario theme while expr is executing, plays the flag pole jingle when the execution have finished. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
ir <- structure( iris, class = c("foo", "data.frame") ) | |
rbind.foo <- function(...) rbind.data.frame(...) | |
rbind(ir,iris) | |
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species | |
#ir Numeric,150 Numeric,150 Numeric,150 Numeric,150 factor,150 | |
#iris Numeric,150 Numeric,150 Numeric,150 Numeric,150 factor,150 | |
``` | |
So apparently we get the same as : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rinternals.h> | |
#include <Rinterface.h> | |
extern void* R_GlobalContext ; | |
#define R_NO_REMAP | |
#define USE_RINTERNALS | |
#include <R.h> | |
#include <Rinternals.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(purrr) | |
library(github) # install_github("cscheid/rgithub") | |
library(dplyr) | |
library(stringr) | |
library(magrittr) | |
# Download issues --------------------------------------------------------- | |
ctx <- interactive.login("56b637a5baffac62cad9", "8e107541ae1791259e9987d544ca568633da2ebf") | |
issues1 <- get.repository.issues("hadley", "dplyr", per_page = 100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2013 Romain Francois | |
// | |
// This file is part of Rcpp11. | |
// | |
// Rcpp11 is free software: you can redistribute it and/or modify it | |
// under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 2 of the License, or | |
// (at your option) any later version. | |
// | |
// Rcpp11 is distributed in the hope that it will be useful, but |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Rcpp) | |
sourceCpp( "dots.cpp" ) | |
x <- 1 | |
f <- function(...) { | |
x <- 2 | |
g(..., b = x) | |
} | |
g <- function(...) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
NumericVector rowApply0(NumericMatrix& x, const Function& FUN) | |
{ | |
int n = x.nrow(); | |
NumericVector result = no_init(n); | |
for (int r = 0; r < n; r++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Rcpp.h> | |
using namespace Rcpp; | |
typedef SEXP (*CCODE)(SEXP, SEXP, SEXP, SEXP); | |
/* Information for Deparsing Expressions */ | |
typedef enum { | |
PP_INVALID = 0, | |
PP_ASSIGN = 1, | |
PP_ASSIGN2 = 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dplyr.h> | |
// [[Rcpp::depends(BH,dplyr)]] | |
using namespace Rcpp ; | |
using namespace dplyr ; | |
class IndexHelper { | |
public: | |
IndexHelper( int pos_, int n_) : pos(pos_), n(n_){} | |