similar to: named arguments discouraged in `[.data.frame` and `[<-.data.frame`

Displaying 20 results from an estimated 9000 matches similar to: "named arguments discouraged in `[.data.frame` and `[<-.data.frame`"

2018 Nov 29
2
named arguments discouraged in `[.data.frame` and `[<-.data.frame`
Thanks Bill and Michael for taking the time to share your knowledge! As a further background to my question, here are two examples that I forgot to include in my original post (reminded by Michael's answer). I swapped the i and j arguments in `[.data.frame` and `[<-.data.frame`. With warnings, but else without (?) problem. Using Bill's data: `[.data.frame`(x = d, i = 1, j = 2) # [1]
2018 Nov 28
0
named arguments discouraged in `[.data.frame` and `[<-.data.frame`
They can get bitten in the last two lines of this example, where the 'x' argument is not first: > d <- data.frame(C1=c(r1=11,r2=21,r3=31), C2=c(12,22,32)) > d[1,1:2] C1 C2 r1 11 12 > `[`(d,j=1:2,i=1) C1 C2 r1 11 12 Warning message: In `[.data.frame`(d, j = 1:2, i = 1) : named arguments other than 'drop' are discouraged > `[`(j=1:2,d,i=1) Error in (1:2)[d, i =
2018 Nov 29
0
named arguments discouraged in `[.data.frame` and `[<-.data.frame`
Well, the situation with `[.data.frame` (and [<-) is complicated by the fact that the data.frame-method is not a primitive, but the generic IS. I'm not sure about dispatch for primitive-generics, but I bet it's done on the first argument (as with S3). Which means `[`(j=1:2,d,i=1) has nothing to do with `[.data.frame`, as some internal code equivalent to something like `[.integer` is
2008 Nov 30
6
Regex: workaround for variable length negative lookbehind
Hi all I have the following regular expression problem: I want to find complete elements of a vector that end in a repeated character but where the repetition doesn't make up the whole word. That is, for the vector vec: vec<-c("aaaa", "baaa", "bbaa", "bbba", "baamm", "aa") I would like to get "baaa" "bbaa"
2006 Aug 03
2
efficient way to make NAs of empty cells in a factor (or character)
Dear all, I have some csv-files (originating from Excel-files) containing empty cells. In my example file I have four variables of different classes, each with some empty cells in the original csv-file: > test <- read.csv2("test.csv", dec=".") > test id id2 x y 1 a 1 NA 2 b e NA 2.2 3 f 3 3.3 4 c g 4 4.4 > class(test$id) [1]
2006 Aug 06
2
paired t-test. Need to rearrange data?
Dear all, I have received some data arranged like this: # original data id <- rep(letters[1:6], each=2) time <- as.factor(rep(1:2, 6)) y <- as.vector(replicate(6, c(rnorm(n=1, mean=1), rnorm(n=1, mean=2)))) test.data <- data.frame(id, time, y) test.data I would like to perform a paired t-test of the y-values at time=1 against those at time=2, with samples paired by their id. Is it
2008 Apr 29
2
help text for xlim
Dear R-developers, A student asked me today of how to specify the limits of the x-axis. I knew that he should use xlim, but I tried to encourage him to have a try himself with the various help functions. I do not judge if he used the correct search strategy or right key words, but anyway here is what he tried: he looked at ?plot. There xlim is not mentioned. He checked ?par. There you find
2010 Jan 11
2
Documentation: format of read.table help text (PR#14180)
Dear R developers, I find the format of descriptions of the arguments in the read.table help text slightly inconsistent. For example, the logical arguments comes in seven different formats, more or less explicit about the consequences of a TRUE (or FALSE): 1. check.names logical. If TRUE then the names... 2. blank.lines.skip logical: if TRUE blank lines... 3. flush logical: if TRUE,
2009 Dec 17
2
Wrong links in help help files? (PR#14155)
Dear R developers, ?help.search ...opens a tab in my browser (Firefox 3.5.6, Win XP): http://127.0.0.1:31642/library/utils/html/help.search.html When I click on the link for "?", (http://127.0.0.1:31642/library/utils/help/?) in the last line of "Details", I get an error message: "Server error: invalid response from R". Similarly, The link to "??"
2005 Nov 30
1
SciViews-R_0.8-9 Console problem
Dear R users, I successfully installed SciViews the other day. However, when I try to run it now, the command/script window does not appear. Strange. Well, actually I see a tendency to a script window (in the lower part of the sciview window where it is suppose to be) during start up, but when the program is entirely open, the script window is gone. I have tried to uninstall and reinstall
2010 Jan 02
2
help with for loop
Dear useRs, I want to write a function that generates all the possible combinations of diff(). Example: If my vector has length 5, I need the diff() until lag=4 -> c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3), diff(my.vec, lag=4)) If it has length 4, I need until lag=3 -> c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3)) So, it must be until lag=(length(my.vec)-1).
2019 May 31
2
[patch] add sanity checks to quantile()
The attached patch adds some sanity checks to the "type" argument of quantile(). Output from the following commands show the change of behavior with the current patch: vec <- 1:10 quantile(vec, type = c(1, 2)) quantile(vec, type = 10) quantile(vec, type = "aaa") quantile(vec, type = NA_real_) quantile(vec, type = 4.3) quantile(vec, type = -1) Current behavior
2008 Dec 16
0
[LLVMdev] Another compiler shootout
On Tuesday 16 December 2008 01:03:36 Evan Cheng wrote: > FYI. http://leonardo-m.livejournal.com/73732.html > > If anyone is motivated, please file bugs for the losing cases. Also, > it might make sense to incorporate the tests into our nightly tester > test suite. FWIW, I just ported my ray tracer benchmark to C and found that llvm-gcc gives much worse performance than gcc on x86
2008 Mar 13
3
fast way to compare two matrices of combinations
I have a list (length 750), each element containing a vector of unique strings (unique gene ids), with length up to ~40 (median 15). I want to compile a matrix of all possible triplets and their frequency within gene elements. Using combn and a lot of looping, I am accomplishing this but it is VERY slow. I've tried to figure out a way to vectorize this, using "match" and
2008 Dec 24
3
Extract values based on indexes without looping?
Dear R-Helpers: I am a entry level user of R. Have the following question. Many thanks in advance. # value.vec stores values value.vec <- c('a','b','c') # which.vec stores the locations/indexs of values in value.vec. which.vec <- c(3, 2, 2, 1) # How can I obtain the following vector based on the value.vec and which.vec mentioned above # vector.I.want <-
2002 Aug 21
1
is.numeric()
Dear R-list I am having troubles understanding how the function is.numeric() works. Any help appreciated. Some commands are given here (the output and my comments are given below) vec <- c(1.4, NA, NA, NA) sapply(vec,FUN=is.numeric) is.numeric(vec[2]) is.na(vec[2]) is.numeric(NA) vec <- c(TRUE, FALSE, NA, NA) sapply(vec,FUN=is.numeric) is.numeric(vec[2]) is.numeric(vec[3])
2008 Dec 23
1
quotation problem/dataframe names as function input argument.
Dear R friends: Can someone help me with the following problem? Many thanks in advance. # Problem Description: # I want to write functions which take a (character) vector of dataframe names as input argument. # For example, I want to extract the number of observations from a number of dataframes. # I tried the following: nobs.fun <- function (dframe.vec) { nobs.vec <-
2007 Oct 26
1
[Fwd: Re: subsetting]
Sorry that I was unclear. For an individual to qualify for my analysis I want both of the following two criteria to be fulfilled: First, I want to select measurement taken at a certain age: for the focal individual the year of measurement (year) should be the same as year.hatch Second, I want the focal individual to be born by a mother that reproduces for the first time. So the /parents /of
2016 Aug 04
1
findInterval(all.inside=TRUE) for degenerate 'vec' arguments
What should findInterval(x,vec,all.inside=TRUE) return when length(vec)<=1, so there are no inside intervals? R-3.3.0 gives a decreasing map of x->output when length(vec)==1 and -1's when length(vec)==0. Would '0' in all those cases be better? > findInterval(x=c(10, 11, 12), vec=11, all.inside=TRUE, rightmost.closed=FALSE, left.open=FALSE) [1] 1 0 0 >
2009 Sep 01
2
cbind objects using character vectors
Dear list, I have a character vector such vec.names<- c("a", "b") It happens that I have also two R objects called "a" and "b" that I would like to merge. Is it possible to do something like cbind(vec.names[1], vec.names[2]) ending up with the same result as cbind(a,b) Bellow is a reproducible example of what I need to to: dat<-