pryr

library(pryr) returns a message. Registered S3 method overwritten by 'pryr': method from print.bytes Rcpp

会有一股神秘感。 提交于 2020-01-25 08:49:05
问题 When I active a package called pryr . It returns a message library(pryr) Registered S3 method overwritten by 'pryr': method from print.bytes Rcpp. I would like to know what does it is mean? However the package runs properly. That message shows only one time each session. 回答1: It means that both Rcpp and pryr have an S3 method (a function) called print.bytes . That is, a print method for an object of the bytes class. Since you now loaded pryr , the function from pryr will be used, not the one

Is 'show_c_source()' broken?

ぃ、小莉子 提交于 2019-12-12 17:18:41
问题 Been trying to use show_c_source() from Hadley Wickhams pryr package, and every time I get the following error message: Error in file(con, "r") : cannot open the connection Even the examples provided in the function documentation do not work: > example("show_c_source") shw_c_> ## No test: shw_c_> show_c_source(.Internal(mean(x))) Error in file(con, "r") : cannot open the connection I'm running this on a 10.11.3 Mac OSX, R 3.2.4 来源: https://stackoverflow.com/questions/38353760/is-show-c-source

saving a base r plot as an object that can be plotted in a multiplot

匆匆过客 提交于 2019-12-08 06:35:36
问题 This question builds from a related post which shows how to easily store a plot as an r object with the %<a-% function from the pryr package. Great! However, I now want to create a multiplot that combines a base r plot with 2 ggplot figures. I am using grid.arrange below. Using the base r cars data I can make two ggplot figures. library(ggplot2) library(pryr) library(gridExtra) Fig1 <- qplot(speed, data=cars, geom="histogram") Fig2 <- qplot(dist, speed, data=cars, geom="point") I then make a

saving a base r plot as an object that can be plotted in a multiplot

半世苍凉 提交于 2019-12-06 15:33:24
This question builds from a related post which shows how to easily store a plot as an r object with the %<a-% function from the pryr package. Great! However, I now want to create a multiplot that combines a base r plot with 2 ggplot figures. I am using grid.arrange below. Using the base r cars data I can make two ggplot figures. library(ggplot2) library(pryr) library(gridExtra) Fig1 <- qplot(speed, data=cars, geom="histogram") Fig2 <- qplot(dist, speed, data=cars, geom="point") I then make a figure with plot , and save the figure as an object using the %<a-% function from the pryr package.

Function generation; change defaults of other functions (partial)

久未见 提交于 2019-12-06 02:57:59
问题 I have the need for a function generator that takes another function and any arguments of that function and sets new defaults. I thought @hadley's pryr::partial was that magic function. It does exactly what I want except you can't then change that new default. So here I can change sep in my new paste function but not the new default of collapse = "_BAR_" . How can I make partial perform this way (i.e., default to collapse = "_BAR_" but enable setting it to collapse = NULL if desired)? If this

Function generation; change defaults of other functions (partial)

独自空忆成欢 提交于 2019-12-04 07:22:51
I have the need for a function generator that takes another function and any arguments of that function and sets new defaults. I thought @hadley's pryr::partial was that magic function. It does exactly what I want except you can't then change that new default. So here I can change sep in my new paste function but not the new default of collapse = "_BAR_" . How can I make partial perform this way (i.e., default to collapse = "_BAR_" but enable setting it to collapse = NULL if desired)? If this is not possible with partial is there a way to rewrite the code for partial to do this: https://github