similar to: oddity in transform

Displaying 20 results from an estimated 3000 matches similar to: "oddity in transform"

2018 Jul 24
2
oddity in transform
The idea is that one wants to write the line of code below in a general way which works the same whether you specify ix as one column or multiple columns but the naming entirely changes when you do this and BOD[, 1] and transform(BOD, X=..., Y=...) or other hard coding solutions still require writing multiple cases. ix <- 1:2 transform(BOD, X = BOD[ix] * seq(6)) On Tue, Jul 24, 2018 at
2018 Sep 14
3
Bug when calling system/system2 (and request for Bugzilla account)
Hi all, I found some strange behaviour, which I think is a bug. Could someone make an account for me on Bugzilla or pass on my report? The problem: When pressing Ctrl-C when a file is sourced in R, run from Terminal (macOS), sometimes the entire session is ended right away, while I just want to stop the script. This is the case when I press Ctrl-C while some functions are running that don?t
2018 Oct 02
1
Relevel confusing with numeric value
Something that bit me: The function relevel takes a factor, and a reference level to be promoted to the first place. If ?ref? is a character this level is promoted, if it?s a numeric the ?ref?-th level is promoted. Which turns out to be very confusing if you have factor with numeric values (e.g. when reading in a csv with some dirty numeric columns and stringsAsFactors TRUE) For example:
2018 Sep 14
2
Bug when calling system/system2 (and request for Bugzilla account)
I hope it's not too specific in my setup... I've tried with system2 added on the first line, so: Example.R: system2('ls', timeout=5) cat('Start non-interruptable functions\n') sample_a <- sample(1:1e7) sample_b <- sample(1:2e7) matching <- match(sample_a, sample_b) cat('Finished\n') Sys.sleep(10) And in terminal/bash: R --vanilla
2018 Aug 29
7
ROBUSTNESS: x || y and x && y to give warning/error if length(x) != 1 or length(y) != 1
# Issue 'x || y' performs 'x[1] || y' for length(x) > 1. For instance (here using R 3.5.1), > c(TRUE, TRUE) || FALSE [1] TRUE > c(TRUE, FALSE) || FALSE [1] TRUE > c(TRUE, NA) || FALSE [1] TRUE > c(FALSE, TRUE) || FALSE [1] FALSE This property is symmetric in LHS and RHS (i.e. 'y || x' behaves the same) and it also applies to 'x && y'.
2018 Jun 09
4
Date class shows Inf as NA; this confuses the use of is.na()
And now I've seen I copied the wrong part of ?is.na > The default method for is.na applied to an atomic vector returns a logical vector of the same length as its argument x, containing TRUE for those elements marked NA or, for numeric or complex vectors, NaN, and FALSE otherwise. Key point being "atomic vector" here. On Sat, Jun 9, 2018 at 1:41 PM, Joris Meys <jorismeys at
2018 Jul 24
0
oddity in transform
I think you meant to call BOD[,1] From ?transform, the ... arguments are supposed to be vectors, and BOD[1] is still a data.frame (with one column). So I don't think it's surprising transform gets confused by which name to use (X, or Time?), and kind of compromises on the name "Time". It's also in a note in ?transform: "If some of the values are not vectors of the
2018 Jul 24
0
oddity in transform
I don't think it has much to do with transform in particular: > BOD <- data.frame(Time = 1:6, demand = runif(6)) > BOD[["X"]] <- BOD[1:2] * seq(6); BOD Time demand X.Time X.demand 1 1 0.8649628 1 0.8649628 2 2 0.5895380 4 1.1790761 3 3 0.6854635 9 2.0563906 4 4 0.4255801 16 1.7023206 5 5 0.5738793 25 2.8693967 6 6 0.9996713
2018 Oct 15
4
sys.call() inside replacement functions incorrectly returns *tmp*
Kia Ora Let's say we have: "myreplacementfunction<-" = function (..., value) { call = sys.call () print (as.list (call) ) 0 } Then we call: x = 0 myreplacementfunction (x, y, z) = 0 It will return: [[1]] `myreplacementfunction<-` [[2]] `*tmp*` [[3]] y [[4]] z $value <promise: 0x06fb6968> There's two problems here. Firstly, x has to be defined otherwise we
2018 Jul 30
5
apply with zero-row matrix
Forgive me if this has been asked many times before, but I couldn't find anything on the mailing lists. I'd expect apply(m, 1, foo) not to call `foo` if m is a matrix with zero rows. In fact: m <- matrix(NA, 0, 5) apply(m, 1, function (x) {cat("Called...\n"); print(x)}) ## Called... ## [1] FALSE FALSE FALSE FALSE FALSE Similarly for apply(m, 2,...) if m has no columns. Is
2018 Aug 15
5
validspamobject?
Greetings, My R package has been showing warnings of the form: `validspamobject()` is deprecated. Use `validate_spam()` directly None of my code uses the function validspamobject, so it must be a problem in another package I'm calling, possibly spam or spdep. Has this problem occurred with other people? It doesn't have any deleterious effect, but it's annoying. In particular,
2007 Nov 24
5
how to calculate the return?
Hi, R-users, data is a matrix like this AMR BS GE HR MO UK SP500 1974 -0.3505 -0.1154 -0.4246 -0.2107 -0.0758 0.2331 -0.2647 1975 0.7083 0.2472 0.3719 0.2227 0.0213 0.3569 0.3720 1976 0.7329 0.3665 0.2550 0.5815 0.1276 0.0781 0.2384 1977 -0.2034 -0.4271 -0.0490 -0.0938 0.0712 -0.2721 -0.0718 1978 0.1663 -0.0452 -0.0573 0.2751 0.1372 -0.1346
2007 Sep 07
3
Delete query in sqldf?
Dear All, Is sqldf equipped with delete queries? I have tried delete queries but with no success. Thanks in advance, Paul
2018 Jun 11
2
Date class shows Inf as NA; this confuses the use of is.na()
Emil et al., On Mon, Jun 11, 2018 at 1:08 AM, Emil Bode <emil.bode at dans.knaw.nl> wrote: > I don't think there's much wrong with is.na(as_date(Inf, > origin='1970-01-01'))==FALSE, as there still is some "non-NA-ness" about > the value (as difftime shows), but that the output when printing is > confusing. The way cat is treating it is clearer: it
2009 Dec 24
3
help in merging
Hi All, I want to "merge" two datasets by column "ID" and I don't want the result to be sorted by "ID". I am doing the following: > z = merge(x, y, by = "ID", sort=F) The result is not sorted by "ID". But (as oppose to what I expected) it is not even in the original order of either "x" or "y". Can
2018 Nov 30
2
Unexpected argument-matching when some are missing
But the main point is where arguments are mixed together: > debugonce(plot.default) > plot(x=1:10, y=, 'l') ... Browse[2]> missing(y) [1] FALSE Browse[2]> y [1] "l" Browse[2]> type [1] "p" I think that's what I fall over mostly: that named, empty arguments behave entirely different from omitting them (", ,") And I definitely agree we need
2010 Jun 27
2
Ways to work with R and Postgres
Hi, I post this message to the general r-help list hoping anyone within a wider range have suggestions: There are three ways to integration R and postgres, especially on 64bit Microsoft windows Platform, 1. via RODBC package, which has 32 bit and 64 bit version for windows 2. via RPostgres interface, which only has 32bit version currently 3. via plr for Greenplum, which only supports a
2018 Aug 31
3
compairing doubles
Agreed that's it's rounding error, and all.equal would be the way to go. I wouldn't call it a bug, it's simply part of working with floating point numbers, any language has the same issue. And while we're at it, I think the function can be a lot shorter: .is_continous_evenly_spaced <- function(n){ length(n)>1 && isTRUE(all.equal(n[order(n)], seq(from=min(n),
2011 Apr 20
1
Sqldf INSERT INTO
Hi, I am new to R and trying to migrate from SAS. I am trying to copy data from one table to another table which have same columns using sqldf. but not working and showing "NULL" I wrote statement as sqldf("INSERT INTO new select * from data") but showing NULL Please help me in this regard. Thank you -- View this message in context:
2009 Jul 15
2
Spaces in a name
I am reading regressors from an excel file (I have no control over the file) and some of the element names have spaces: i.e. "Small Bank Aquired" but I have found that lm(SourceData ~ . - "Small Bank Aquired", mcReg) doesn't work (mcReg = modelCurrentRegressors) As they are toggles I have ran them through factor() to be treated propertly as 0 or 1 but due to the fact I