similar to: Bug: dput/deparse with named character vector inside list

Displaying 20 results from an estimated 100 matches similar to: "Bug: dput/deparse with named character vector inside list"

2020 Jan 14
1
CRAN check fails if website is unavailable on Fedora platforms
Hi all, I maintain the package ?qrandom? which is based on a web API. In last time the testthat tests failed because the website was down. I implemented the following code in v1.2.2 to ensure that tests are only run if the website is accessible and to avoid the CRAN checks to fail: > library(testthat) > library(qrandom) > check_qrng <- function(){ > tryCatch( >
1997 Oct 08
0
R-alpha: dump() / dput() -- fail for "environmental" and attributed functions
Here is a simple example to show what I mean: f1 <- approxfun(1:3, 2:4) dump("f1", file="") which yields (in current development snapshot; other versions are conceptually equivalent) "f1" <- function (v) .C("approx", as.double(x), as.double(y), n, xout = as.double(v), length(v), as.integer(method), as.double(yleft),
1999 Nov 01
0
as.data.frame(NULL) & as.data.frame(list()) & bug in dput(.)
{Connected to the bug report on expand.grid(.) and my fix to it..} [Following the spirt of arrays where parts of dim() can be 0] I would like for these two to give the "same" or at least, both to give a data.frame with 0 observations of 0 variables. Currently [R 0.65.1 and pre-0.90] > str(d0 <- as.data.frame(list())) `data.frame': 0 obs. of 0 variable: list()
2006 Oct 25
1
sourcing dput output
Is this not supposed to work? > dput(BOD, file = "/BOD.R") > source("/BOD.R") Error in attributes(.Data) <- c(attributes(.Data), attrib) : row names must be 'character' or 'integer', not 'double' > dput(iris, file = "/iris.R") > source("/iris.R") Error in attributes(.Data) <- c(attributes(.Data), attrib) :
2007 Apr 22
1
dput/dget when a data frame has 2 rows (PR#9627)
This doesn't seem right; I'm using R version 2.4.1 (2006-12-18) on Mac OS and Win XP and find the same issue: > mydataframe <- data.frame(ppi=c(.5,.5),mmu=c(5,10)) > dput(mydataframe,"mydataframe.txt") > dget("mydataframe.txt") Error in attributes(.Data) <- c(attributes(.Data), attrib) : row names must be 'character' or 'integer', not
2007 Oct 17
1
dget not restoring dput in R 2.6.0 (PR#10350)
Full_Name: David States Version: 2.6.0 OS: Windows XP64 Submission from: (NULL) (141.211.38.9) # The pair of commands # # dput(object, "file.dput") # object = dget("file.dput") # # should be a no op, but this is not working correctly for all objects. # # Simple example: # # make a simple object of class "hclust" cl = hclust(dist(matrix(nrow=4,ncol=4, c(1:16)))) #
2012 Aug 28
1
Don't dput() data frames?
/src/main/attrib.c contains this comment in row_names_gets(): /* This should not happen, but if a careless user dput()s a data frame and sources the result, it will */ which svn blame says Prof Ripley placed there in r39830 with the commit message "correct the work of dput() on the row names of a data frame with compact representation." Is there a problem / better way to
2014 May 27
1
dput line width
Is there some way to control the line width that dput uses? options(width=...) does not affect dput. For example, currently > dput(1:30*2) c(2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, *line break here* 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60) but on a wider display, I'd like to have no line break. Tested on R version 3.1.0 (2014-04-10)
2018 Sep 29
1
Improvement to documentation in dput.Rd
If the "Matrix" package is attached, 'example(dget)' fails: > library(Matrix) > example(dget) dget> fil <- tempfile() dget> ## Write an ASCII version of function mean to our temp file dget> dput(mean, fil) dget> ## And read it back into 'bar' dget> bar <- dget(fil) Error in initialize(value, ...) : '...' used in
2020 Feb 29
0
dput()
On 29/02/2020 4:19 a.m., Ben Bolker wrote: > > I think Robin knows about FAQ 7.31/floating point (author of > 'Brobdingnag', among other numerical packages). I agree that this is > surprising (to me). > > To reframe this question: is there way to get an *exact* ASCII > representation of a numeric value (i.e., guaranteeing the restored value > is identical()
2005 Feb 09
1
dput() error
Hi I'm trying to debug one of my functions, which stopped with the following message: Error in is.vector(x.star) : subscript out of bounds So I put a "print(x.star)" statement in just before the is.vector bit and got Error in print(x.star) : subscript out of bounds So I put "dput(x.star)" in and got Error in dput(x.star) : subscript out of bounds what's
1999 May 27
1
Factor structures not preserved after dump/dput (PR#200)
Full_Name: Marek Ancukiewicz Version: 0.64.0 OS: Linux (RedHat 6.0) Submission from: (NULL) (132.183.12.87) I've noticed that factor structures get recoded when the data is dumped using either dump or dput and then restored with source or dget. This occurs when the values taken by factors do not include 1. For example: a <-
1999 Feb 12
1
more on dput
I would like to write data so that I can re-read it and reproduce results, preferably in both R and Splus. In the past when I have done this my data has been relatively simple and I've just scan()ed it. Now I have a fairly complicated structure I would like to preserve and I've been trying to use dput and dget. Is there a better way? If not, the following truncation by dput, which I
2024 Mar 01
2
dput(..., file = stderr())
Curious to know if this warning is expected behavior, and if so, what is the recommended way instead: > dput(letters, file = stderr()) c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p",
2004 Jul 15
1
dput and dget
I am seeking advice about dput() and dget(). We are using the ascii format supported by these functions as a way to write data from other programs that can be read into R easily. We are able to save complicated results (in the form of an R list) to a single file that can be read trivially into R or S-Plus. My question is whether that format can be considered a safe one for medium-term (say
2006 Oct 10
1
error in dput applied to dataframe (PR#9286)
Full_Name: Daniel F Higgins Version: 2.4.0 OS: Windows XP and Mac OSX Submission from: (NULL) (128.111.242.49) Create a dataframe as indicated below and apply 'dput' to it; note that the row.names attribute is incorrect! > aaa <- c("AAA","BBB","AAA") > bbb <- c(1,2,3) > df <- data.frame(aaa,bbb) > dput(df) structure(list(aaa =
2007 Feb 02
2
A question about dput
Hi, I am trying to output a R data set for use in WinBugs, I used dput(list(x=rnorm(100),N=100),file="bug.dat") But I can't get the intended format: list(x=c(.......),N=100), instead, I got something like this (copied the first two lines): [00000000]???73?74?72?75??63?74?75?72??65?28?6C?69??73?74?28?78???? structure(list(x
2011 Aug 24
3
dput data frame
I have a data frame that is about 40 columns by 10000 rows. I want to get the dput of small portion of that by using dput(results[1:10,3:6]). The dput is very long and includes all the values from the original data frame. Why is that? Jeffrey
2008 Feb 25
1
how to write dput-able objects
Hi, One way of doing object-oriented programming in R is to use function environment to hold object's data, see for example @Article{Rnews:Chambers+Lang:2001a, author = {John M. Chambers and Duncan Temple Lang}, title = {Object-Oriented Programming in {R}}, journal = {R News}, year = 2001, volume = 1, number = 3, pages = {17--19},
2012 Jun 19
1
how to manipulate dput output format
I am reading into Java dput output for a matrix, more specifically for a file backed big-matrix. I basically need to lift dimnames for a matrix from dput output. It's no big deal, but the code is very 'hackish' due to the need to get rid of quotes, endlines, parenthesis, etc. I was wondering if i could manipulate to an extent dput output with some options that define it, for example,