similar to: S4 coercion

Displaying 20 results from an estimated 100 matches similar to: "S4 coercion"

2011 Jun 06
1
RPostgreSQL && snowfall
Dear expeRts, I'm currently trying to get data from a PostgreSQL database _in parallel_. I tried two methods: * passing the DBI Connection object to the cluster nodes * connecting the the DB on each node (1) The execution of the first method looks like this: > result = sfClusterApplyLB(input, fun, dbiCon) and produces an "expired PostgreSQLConnection" error. (Of course the
2008 May 04
1
S4 / S3 / Sweave problem
I'm not sure if this as a bug or something I am doing wrong. It occurs in both 2.7.0 and 2.6.2. require("methods") setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL")) setClass("TSmetax", representation(serIDs="character", ExtractionDate="OptionalPOSIXct" )) setGeneric("TSmetax", def= function(x,
2008 Apr 23
1
S4 default for coercing
Something has changed in the S4 default for coercing. Am I now suppose to use setAs, or is there something else I should do to make this work: R version 2.7.0 (2008-04-22) .... > require("methods") > setClassUnion("OptionalPOSIXct", c("POSIXct", "NULL")) [1] "OptionalPOSIXct" > setClass("TSmetax",
2006 Jul 12
10
Rails: Good for everything?
My department is in a battle right now. We have some very por PHP people and very pro Rails people. The php guys make a good argument that Rails is good for new applications where we dictate the DB schema. PHP shines where we go into an existing application, or a new one where multiple databases or possibly legacy systems are involved. The PHP guys basically say Rails is good for Web 2.0
2011 Aug 23
1
Implementing a "plugin" paradigm with R methods
Dear list, I was wondering how to best implement some sort of a "plugin" paradigm using R methods and the dispatcher: Say we have a function/method ('foo') that does something useful, but that should be open for extension in ONE specific area by OTHERS using my package. Of course they could go ahead and write a whole new 'foo' method including the features they'd
2013 Oct 09
1
No warning for conflicting methods?
It would be really nice if R warned you when packages had conflicting methods. For example (and this took me a couple of hours to track down), RMySQL and RPostgreSQL both define setMethod("print", "dbObjectId"), so that: library(RMySQL) getMethod("print", "dbObjectId") library(RPostgreSQL) getMethod("print", "dbObjectId") Obviously
2012 Mar 24
2
RC / methods package
(I think this is being caused by the new methods package in RC.) In the RC (March 24) some of my packages are generating a Note Note: Method with signature "MySQLConnection#integer" chosen for function "coerce", target signature "TSMySQLConnection#integer". "dbObjectId#integer" would also be valid This is coming from a call to dbGetQuery() in package
2012 Aug 22
1
loading both RPostgreSQL and RSQLite leads to problems
hello, if i load the RSQLite package in addition to the RPostgreSQL package, i get various errors when trying to use RPostgreSQL functions. here is an example transcript showing one such error: ========================================================== R version 2.15.0 (2012-03-30) [...] > packageVersion('RPostgreSQL') [1] 0.3.2 > packageVersion('RSQLite') [1] 0.11.1
2012 Nov 04
0
parallel::mclapply list coercion limits opportunities for code re-use?
The attached diff address the following issues in mclapply mclapply coerces non-lists or objects (S3 or S4) to lists, but a list may not be an efficient representation and is not required if the object implements length, [, and [[ methods (lapply must also work on the object, either through coercion to a list at the 'inner.do' level or through other means, e.g., promoting lapply to a
2008 Mar 11
1
NAs introduced by coercion
Hallo, i get a warning message that NAs are introduced by coercion, so my idea is to write a function to see which values are turned into NA For this i need to write a function to go through (loop) the original data and the transformed (with the introduced na) to see which data were transformed to NA. So the return of this function should be a 2*many matrix like structure, eg names:
2011 Dec 04
0
How to write (complex) coercion methods or "what's the reason to limit 'setAs()' the way it is limited"?
Dear list, I'd like to write coercion methods for some of my Reference Classes. However, using 'setAs()' is not a real option as its argument 'def' only allows for functions depending on one single argument. In some cases, that is simply too much of a limitation for me. And I don't really see why it needs to be this way, so I guess this question is also some sort of a
2007 Oct 17
1
ignorable warnings of as.numeric: NAs introduced by coercion
Warnings are a good thing and can help to find errors in data. But with newer R versions I get more and more warnings which I would like to suppress in defined circumstances. In the manual of as.numeric() is noticed: as.numeric(c("-.1"," 2.7 ","B")) # (-0.1, 2.7, NA) + warning If I know that my data contains characters and if I would like that they will be
2003 Jan 08
0
integer coercion when indexing and subsetting (PR#2430)
At the end of his bug report, Philippe says PhGr> ..... Moreover, the subset operation [] uses as.integer() and PhGr> consequently, can suffer from the same syndrome. A WARNING section in PhGr> Extract.Rd would be welcome too. [BTW: Thank you Philippe! ] Currently, "Extract.Rd" does not say anything on the kind of indices `i' that can be used in things like
2003 Feb 27
0
unwanted coercion of length 0 vectors (PR#2587)
When something is assigned to an element of a vector that was previously of length 0, the vector is coerced to the mode of the something, regardless of whether the coercion is necessary under normal R rules. In particular, if NA is assigned to an element of a vector that was previously length 0, the mode of the vector is coerced to 'logical'. For example, here's the normal behaviour:
2003 May 05
1
segfault when applying strange coercion (PR#2923)
I made a mistake -- and R crashed. A (more or less) reproducible example seems to be: x <- matrix(nrow=20000, ncol=20) x$any <- numeric(0) It is possible to crash R by executing these lines several times (1 - 20) on Windows as well as on Solaris (might be related to PR#2880 - let's call it "non-existing list elements") Uwe Ligges --please do not edit the
2003 Dec 08
1
matrix coercion, logical -> character
Anyone know whether this is intentional, and by which rationale? (R-devel on RedHat, but hardly new) > l <- data.frame(a=rpois(10,1)>0,b=rpois(10,1)>0) > apply(l,1,which) Error in FUN(newX[, i], ...) : argument to "which" is not logical > lapply(l,mode) $a [1] "logical" $b [1] "logical" > mode(as.matrix(l)) [1] "character" --
2017 Mar 09
0
Possible issue with coercion in sprintf()?
Dear R-Devel folks, I've just run into what initially struck me as a rather strange result, as follows: > sprintf('%d', c(1.0, NA)) [1] "1" "NA" > sprintf('%d', c(NA, 1.0)) Error in sprintf("%d", c(NA, 1)) : invalid format '%d'; use format %f, %e, %g or %a for numeric objects So if I pass sprintf() a vector of reals and attempt
2020 Aug 25
0
sum() vs cumsum() implicit type coercion
On 8/23/20 5:02 PM, Rory Winston wrote: > Hi > > I noticed a small inconsistency when using sum() vs cumsum() > > I have a char-based series > > > tryjpy$long > > [1] "0.0022" "-0.0002" "-0.0149" "-0.0023" "-0.0342" "-0.0245" "-0.0022" > > [8] "0.0003" "-0.0001"
2020 Oct 07
0
Coercion function does not work for the ALTREP object
Jiefei, Where does the code for your altrep class live? Thanks, ~G On Wed, Oct 7, 2020 at 4:25 AM Jiefei Wang <szwjf08 at gmail.com> wrote: > Hi all, > > The coercion function defined for the ALTREP object will not be called by R > when an assignment operation implicitly introduces coercion for a large > ALTREP object. > > For example, If I create a vector of length
2004 Jun 15
1
How avoid coercion to character
Hi R-users! I'd like to know how to avoid automatic coercion of numeric variables passed to array() to character, when there is one categorical variable between others. I have tried I() function, but it is just functional in data.frame. Best Regards! Eduardo Dutra de Armas