similar to: Error when modifying names of the object returned by get()

Displaying 20 results from an estimated 30000 matches similar to: "Error when modifying names of the object returned by get()"

2011 Mar 05
2
How to show non user defined data set such as cu.summary (from rpart)?
Hi All, ls() doesn't show cu.summary. ?ls says "When invoked with no argument at the top level prompt, \u2018ls\u2019 shows what data sets and functions a user has defined." Therefore, the reason ls() doesn't show cu.summary is because cu.summary is from a package but not user defined. Is there a way to show not only user defined data sets but also data sets from loaded
2007 Dec 17
1
names in Rscript -e
Hi, I seem to have a problem when passing named parameters to R via Rscript (R2.5.1, bash shell). As soon as I name elements of a list Rscript generates an error. I will appreciate if someone could point to me a correct way of doing this. Thanks, Vadim ## This works bash-3.2$ Rscript.exe -e 'list(1)' [[1]] [1] 1 # and these do not work bash-3.2$ Rscript.exe -e
2020 Sep 09
1
more Matrix weirdness
Am I being too optimistic in expecting this (mixing and matching matrices and Matrices) to work? If x is a matrix and m is a Matrix, replacing a commensurately sized sub-matrix of x with m throws "number of items to replace is not a multiple of replacement length" ... x <- matrix(0,nrow=3,ncol=10, dimnames=list(letters[1:3],LETTERS[1:10])) rr <-
2018 Feb 07
1
release build of ChemmineR failing
The release version of ChemmineR is failing on windows. It seems to be a build script issue though, possibly something on your side. The package was building fine a few weeks ago and I have not modified it. Can you please have a look? Thanks. "C:/Users/BIOCBU?1/BBS-3?1.6-B/R/bin/Rscript" -e "library(rmarkdown); library(BiocStyle); rmarkdown::render('ChemmineR.Rmd')"
2011 Feb 22
3
Weird error (special character) of read.table
Hi, I have the following input file. $ cat main.txt CEL_A CELL_B 1 4 2 5 2 6 Then I run read.table in R. > f=read.table('main.txt', header=T, check.names=F, sep='\t') > head(f) \ufeffCEL_A CELL_B 1 1 4 2 2 5 3 2 6 > f$CEL_A NULL I'm not sure where the special character \ufeff comes from. Could anybody let me know what is the problem?
2017 Jul 06
3
Efficient swapping
Thanks a lot, Ista! I really appreciate it. How about a slightly different case as the following: set.seed(1) (tmp <- data.frame(x = 1:10, R1 = sample(LETTERS[1:5], 10, replace = TRUE), R2 = sample(LETTERS[2:6], 10, replace = TRUE))) x R1 R2 1 C B 2 B B 3 C E 4 E C 5 E B 6 D E 7 E E 8 D F 9 C D 10 A E Notice that the factor levels between
2019 Feb 28
2
Exit status of Rscript
Current R release (3.5.2) and devel return a 0 exit status on error, while prior versions returned a non-zero exit status. On Linux and MacOs, the following line returns TRUE for R-3.5.2 and R-devel, and FALSE for R-3.5.1 and R-3.5.0: system2("Rscript", c("-e", shQuote("stop('foo')"))) == 0 I didn't find this in the NEWS, so I believe this is a bug.
2017 Jul 06
0
Efficient swapping
Untested, but I expect that setting the levels to be the same across the two factors levels(tmp$R1) <- levels(tmp$R2) <- LETTERS[1:6] and proceeding as before should be fine. Best, Ista On Jul 6, 2017 6:54 PM, "Gang Chen" <gangchen6 at gmail.com> wrote: Thanks a lot, Ista! I really appreciate it. How about a slightly different case as the following: set.seed(1) (tmp
2010 Dec 03
2
How to get 'R' to talk BACK to other languages / scripts??
Hey everyone, I know that I can call 'R' from other scripts, and that I can make command calls from 'R' (e.g., using system() ). But how can I get 'R' to RETURN values to the script that called it. E.g., I would like to be able to do something like the following (as a simpler example) from a bash script: #!/bin/bash myTest=echo /usr/local/bin/R --no-restore
2012 Sep 06
1
[Rscript] difficulty passing named arguments from commandline
Wanting a commandline solution (for a problem detailed @ http://mailman.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2012/msg00279.html ) I turned to Rscript, and whacked out the q'n'd https://github.com/TomRoche/GEIA_to_netCDF/blob/master/netCDF.stats.to.stdout.r However it wasn't as quick as hoped, because I spent quite a bit of time figuring out how to pass the arguments.
2010 Feb 23
2
how to pass external parameters to an R script
How, if possible, can I run an R script, from command line, passing external parameters just like I can run a C main program passing parameters: # Cprog p1 p2 p3 Cprog can access its arguments (p1,p2,p3) through the built-in structures "argv" and "argc". Since R is built on C language I would expect the same feature to be available with R scripts as well ... ? Please, notice
2012 Feb 15
1
Cannot use setClass() in Rscript
Greetings, I am creating a standalone executable script using Rscript and have run into problems when I define a new S4 class. Here is a small script that demonstrates my problem: #!/usr/bin/env Rscript # # toy.Rscript -- testing S4 class creation in an Rscript setClass("toy", representation(name = "character", price = "numeric"),
2017 Jul 06
2
Efficient swapping
Suppose that we have the following dataframe: set.seed(1) (tmp <- data.frame(x = 1:10, R1 = sample(LETTERS[1:5], 10, replace = TRUE), R2 = sample(LETTERS[1:5], 10, replace = TRUE))) x R1 R2 1 1 B B 2 2 B A 3 3 C D 4 4 E B 5 5 B D 6 6 E C 7 7 E D 8 8 D E 9 9 D B 10 10 A D I want to do the following: if the difference between the level index of factor
2013 Mar 09
1
Why cannot `Rscript -e` accept an empty line?
See the example below (under Ubuntu): $ Rscript -e '1' -e '2' [1] 1 [1] 2 $ Rscript -e '1' -e '' -e '2' ERROR: option '-e' requires an argument $ uname -a Linux xie 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux Similar problem under Windows: Rscript -e "1" -e "" -e "2" [1]
2009 Mar 24
1
problem with Rscript
Hi all, this is probably some tricky configuration file problem, but I figure someone here might have come across this in the past: In short, I've been using Rscript to run my scripts, usually successfully. But recently I've run into a strange problem, and the only function that causes an error is "print". I can create a file that contains only a print command, and it causes
2017 Jul 06
0
Efficient swapping
How about foo <- with(list(r1 = tmp$R1, r2 = tmp$R2, swapme = (as.numeric(tmp$R1) - as.numeric(tmp$R2)) %% 2 != 0), { tmp[swapme, "R1"] <- r2[swapme] tmp[swapme, "R2"] <- r1[swapme] tmp }) Best, Ista On Thu, Jul 6, 2017 at 4:06 PM, Gang Chen <gangchen6 at gmail.com> wrote: > Suppose that we have the following
2009 Oct 16
1
(PR#14012)
I think Rscript has a problem running files that have mac encodings for newline (^M rather than ^J on linux). If I source the file within R, it works okay: > source('j.R') [1] "MEA_data/sernagor_new/CRX_P7_1.txt" But if I run the file using Rscript on a linux box I get a strange error message: $ Rscript --vanilla j.R " Execution halted The example script j.R is at
2012 Sep 21
1
__FILE__ object in R
Hi - I'm curious if there is a way to get access to the location of the calling script within R. I found one way of accessing it from this thread, https://stat.ethz.ch/pipermail/r-devel/2008-April/048914.html, which recommends using either: parent.frame(2)$ofile Or FILE <- (function() { attr(body(sys.function()), "srcfile") })()$filename However, those suggestions only
2011 Sep 19
1
Rscript path problem on R 2.13.1 for Ubuntu 11.04?
Dear all, finally decided to do an Ubuntu upgrade and a new clean R install from http://cran.r-project.org/bin/linux/ubuntu/. However, while trying to install a package from R-forge I encountered problems, involving error messages saying "Rscript execution error: No such file or directory" (see below). The same procedure works on Ubuntu 11.04 running R 2.12.1-1 from the Ubuntu
2010 Jan 01
5
How to not to terminate read.table if the input file is empty?
read.table terminates the program if the input file is empty. Is there way to let the program continue and return me a NULL instead of terminating the program? $ Rscript read_empty.R > read.table("empty_data.txt") Error in read.table("empty_data.txt") : no lines available in input Execution halted $ cat read_empty.R read.table("empty_data.txt") $ cat