similar to: Subsetting vectors/arrays using factors can be seen as misleading

Displaying 20 results from an estimated 20000 matches similar to: "Subsetting vectors/arrays using factors can be seen as misleading"

2012 Oct 12
3
Loss of dimensions in subsetting arrays
Hi all, I've been wondering for a long time why R drops the dimensions of an array/matrix when you try to take a subset of one column. I mean this: dim(A) [1] 2 5 2 B=A[1,,] dim(B) 5 2 # so now dim(B)[3] doesn't work C=B[2,] dim(C) NULL # so now nrow(C) doesn't work Typically, you can get rid of this by writing as.matrix, as.array(...) but that generates extra lines of code.
2004 Nov 08
3
misleading output after ordering data frame
Dear R users, I have a data frame which I create with read.csv and then order by date: d <- na.omit(read.csv(...)) d <- d[order(as.Date(as.character(d$Date), format="%d-%b-%y"), decreasing=F, na.last=F),] My problem is that even though the data frame is ordered as requested, the old row numbers are preserved. For example: * Before sorting: > d[1:3,] Date Amt 1
2013 Apr 17
1
[LLVMdev] Loop vectorizer behaviour for 2D arrays and parallel annotation
On Wed, Apr 17, 2013 at 8:08 AM, Tobias Grosser <tobias at grosser.es> wrote: > On 04/17/2013 04:55 AM, Anadi Mishra wrote: >> >> Hello, >> >> I am trying to vectorize the following loop but the vectorizer says: >> "Found a possible write-write reorder" and does not vectorize. >> Why? > > > To my knowledge, the dependence analysis in
2006 Sep 04
3
Subsetting vectors based on condition
Hello, I have a question regarding subsetting of vectors. Here's an example of what I'm trying to do: vect.1 <- c(76,195, 290, 380) vect.2 <- c(63, 95, 133, 170, 215, 253, 285, 299, 325, 375) I would like to subset vect.2 so that it has the same length as vect.1, and its numbers are the first corresponging higher value compared to vect.1. The output should be: final.output =
2008 Mar 13
2
How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ?
Hi, How to cbind or rbind different lengths vectors/arrays without repeating the elements of the shorter vectors/arrays ? > cbind(1:2, 1:10) [,1] [,2] [1,] 1 1 [2,] 2 2 [3,] 1 3 [4,] 2 4 [5,] 1 5 [6,] 2 6 [7,] 1 7 [8,] 2 8 [9,] 1 9 [10,] 2 10 [[alternative HTML version deleted]]
2009 Mar 06
1
array subsetting of S4 object that inherits from "array"
Hi, I have an S4 class that inherits from "array" but does not add generic implementations of the "[" method. A simplified example is: setClass("fooarray", contains="array") If I create a "fooarray" object and subset it with a one-dimensional index vector, the return value is of class "fooarray". Other variants (see below), however,
2019 Dec 14
1
Inconsistent behavior for the C AP's R_ParseVector() ?
Hi Simon, Widespread errors would have caught my earlier as the way that code is using only one initialization of the embedded R, is used quite a bit, and is covered by quite a few unit tests. This is the only situation I am aware of in which an error occurs. What is a "correct context", or initial context, the code should from ? Searching for "context" in the R-exts manual
2012 Jan 10
2
short-hand to avoid use of length() in subsetting vectors?
Hi-- I suspect this is a frequently considered (and possibly asked) question, but I haven't thus far found an answer: For slicing a vector with x[?], is there a symbol for length(x)? I'm seeking a short-hand for referring to the length of vector one is trying to index. E.g., for a data.frame, say, > test.frame <-data.frame(matrix(c(1:100),ncol=10,nrow=10,byrow=T)) >
2003 Oct 06
0
randomizing within factors and combining unequal-sized arrays
Dear R folks - Sorry to be so dense, but can you help me with two programming problems? 1. Randomizing within factors. I have factored the values in an array according to a series of ranked breakpoints. Now I want to randomize the values that fall within each of the breakpoint boundaries, without replacement. I want to end up with an array in which the values within each factored category
2010 May 23
2
Subsetting with a list of vectors
Hi, I have a dataset that looks like the one below. data plot plantno. species H 31 ABC D 2 DEF Y 54 GFE E 12 ERF Y 98 FVD H 4 JKU J 7 JFG A 55 EGD . . . . . . .
2005 Feb 17
1
Subsetting using dimnames on S4 array-based class
Hello, I did send this message to r-help and got no reply, no I am resubmitting here in case this was a bit too specific for the other list. Many thanks, Iago From: Iago Mosqueira <imosqueira@suk.azti.es> To: r-help@stat.math.ethz.ch Subject: Subsetting using dimnames on S4 array-based class
2013 Apr 17
0
[LLVMdev] Loop vectorizer behaviour for 2D arrays and parallel annotation
On 04/17/2013 04:55 AM, Anadi Mishra wrote: > Hello, > > I am trying to vectorize the following loop but the vectorizer says: > "Found a possible write-write reorder" and does not vectorize. > Why? To my knowledge, the dependence analysis in the loop vectorizer is not yet able to prove the absence of dependences here. > for (j=0; j < 8; j++) > { > jj
2005 Jun 19
1
1-based arrays and copying vectors
I'm interfacing to C code that uses 1-based indexing on arrays -- it ignores the zeroth element. Thus, input vectors from R must be moved up one, and output arrays must be moved down one. What is the best way to deal with this using R internal code? My current approach is: For an input R vector of length n, allocate a new vector(v) of length n+1 and copy input into v[1] to v[1+n]. Call
2005 Feb 11
0
Subsetting using dimnames on S4 array-based class
Hello, I am encountering some problems when overloading the "[" operator for a new S4 class based on array. This is an example class definition: setClass("foo", representation("array"), prototype(array(NA, dim=c(3,3)), dimnames=list(age=1:3, year=10:12)) ) And this the corresponding setMethod with print estatements to see what is being passed:
2007 Nov 10
2
be_success misleading
Just wondering if anyone else thinks that ''response.should be_success'' is potentially misleading. If you''re writing a spec for an action that is failing in some way it can still have a status 200. So while the HTTP request was technically successful, something in the action was not. Perhaps something like ''response.should have_success_status''? Steve
2014 Mar 05
1
Sweave provides a misleading error when vignette engine not fully specified
Trying to Stangle / Sweave a file $ cat vignette.Rnw %\VignetteEngine{knitr} \documentclass{article} \begin{document} \end{document} results in a misleading error message: ~/tmp$ R CMD Stangle vignette.Rnw Error: Vignette engine package not specified Execution halted when what is missing is the full specification knitr::knitr; 'vignette engine package and function not specified' ?
2003 Jan 19
0
[Bug 471] New: Misleading error message if /dev/tty permissions wrong
http://bugzilla.mindrot.org/show_bug.cgi?id=471 Summary: Misleading error message if /dev/tty permissions wrong Product: Portable OpenSSH Version: 3.4p1 Platform: ix86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: ssh AssignedTo: openssh-unix-dev at mindrot.org
2003 Oct 08
1
[Bug 734] Misleading error message when host key verification is impossible / SSH_ASKPASS impossible.
http://bugzilla.mindrot.org/show_bug.cgi?id=734 Summary: Misleading error message when host key verification is impossible / SSH_ASKPASS impossible. Product: Portable OpenSSH Version: 3.6.1p2 Platform: All OS/Version: Linux Status: NEW Severity: trivial Priority: P5 Component: ssh
2003 Dec 21
1
Dialing dead SIP peers give misleading (BUSY) voicemail result ...
Folks, We have several people using SIP softphones in the office. When they leave for the day, they power down their workstations, causing their registration with Asterix to quickly timeout. Here's the entry for one such extension in extensions.conf: exten => 8102,1,Dial(SIP/someone,20) exten => 8102,2,Voicemail(u8102) exten => 8102,3,Hangup exten => 8102,102,Voicemail(b8102)
2006 Oct 31
0
6269165 misleading comments in usr/src/cmd/stat/iostat/iostat.c
Author: petede Repository: /hg/zfs-crypto/gate Revision: ef5d30f0abff39691966b9805b895f3c757b5a9f Log message: 6269165 misleading comments in usr/src/cmd/stat/iostat/iostat.c 6286482 remove the only occurrence of "shit" in OpenSolaris 6231501 Typo in <sys/fem.h> Contributed by Shawn Walker <binarycrusader at gmail.com>. Files: update: usr/src/cmd/stat/iostat/iostat.c