similar to: subsetting matrix according to columns with character index

Displaying 20 results from an estimated 10000 matches similar to: "subsetting matrix according to columns with character index"

2012 May 25
3
Multiple cbind according to filename
Hi all, I'm just a beginner with R but I have not been able to search for any relevant answer to my problem. I apologize if it has in fact been asked before. Recently I've realized that I need to combine hundreds of pairs of data frames. The filenames of the frames I need to combine have unique strings. This is my best guess as to the approach to take: filenames<-list.files()
2007 Jul 31
5
extract columns of a matrix/data frame
Hello all, I have a matrix whose column names look like a1 a2 b1 b2 b3 c1 c2 1 2 3 7 1 3 2 4 6 7 8 1 4 3 Now, I can have any number of a's. not just two as shown above and same goes for b's and c's. I need to extract all the a's columns and put them in another matrix, extract all b's columns and put them in some matrix
2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2012 Apr 19
3
How to "flatten" a multidimensional array into a dataframe?
Hi, I have a three dimensional array, e.g., my.array = array(0, dim=c(2,3,4), dimnames=list( d1=c("A1","A2"), d2=c("B1","B2","B3"), d3=c("C1","C2","C3","C4")) ) what I would like to get is then a dataframe: d1 d2 d3 value A1 B1 C1 0 A2 B1 C1 0 . . . A2 B3 C4 0 I'm sure there is one function to do
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies from row to row and sep(s) are a mixture of tab and semi colon (;) and example is HEADER1 HEADER2 HEADER3 HEADER3 A1 B1 C1 X11;X12;X13 A2 B2 C2 X21;X22;X23;X24;X25 A3 B3 C3 A4 B4 C4 X41;X42;X43 A5 B5 C5 X51 etc., say. Note that a blank
2010 Feb 09
2
How can I rearange my dataframe
An embedded and charset-unspecified text was scrubbed... Name: ??????????? URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100209/db12d14b/attachment.pl>
2005 Oct 18
6
Subsetting a list
Colleagues, I have created a list in the following manner: TEST <- list(c("A1", "A2"), c("B1", "B2"), c("C1", "C2")) I now want to delete one element from the list, e.g., the third. The command TEST[[3]] yields (as expected): [1] "C1" "C2" The command TEST[[-3]] yields: Error:
2004 Jun 08
3
Comparing two pairs of non-normal datasets in R?
Hi all, I'm using R to analyze some research and I'm not sure which test would be appropriate for my data. I was hoping someone here might be able to help. Short version: Evaluate null hypothesis that change A1->A2 is similar to change C1->C2, for continuous, non-normal datasets. Long version: I have two populations A and C. I take a measurement on samples of these
2008 Jul 22
2
Cannot re-start R after bus error
Hi, I ran a program that was exhausting the (unix) server's available memory. I got a bus error and then chose to save and quit workspace (option 4). That may not have been a smart idea - when I try to use R now, I get the error message: Error in load(name, envir = .GlobalEnv) : ReadItem: unknown type 0, perhaps written by later version of R Fatal error: unable to restore saved data in
2012 Aug 28
5
Cut command behaviour - bug or feature
Greetings, I have a CSV file with three fields. eg. a1,b1,c1 a2,b2,c2 .... I wanted the output to be: b1,c1,a1 b2,c2,a2 .... the command cut -d, -f2,3,1 <file> returns a1,b1,c1 cut -d, -f2,3 <file> works as advertised. Is it specific to linux? In that case how do I go about swapping two columns? I do not think a gazzillion byte gui is required. The file size is about 43Megs.
2005 Jun 03
2
rearrange data
Dear all: I have this: A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3 And I want this A1 E1 B1 E1 C1 E1 D1 E1 A2 E2 B2 E2 C2 E2 D2 E2 A3 E3 B3 E3 C3 E3 D3 E3 Example: m<- matrix(1:15,nrow=3,byrow=T) m v<- unlist(list(t(m[,1:4]))) u<- rep(c(5,10,15),c(4,4,4)) data.frame(v,u) This is the result I want but I would like to learn a simpler way to do it. Any clue?
2016 Feb 15
24
[PATCH 01/23] nv50: import updated g80_defs.xml.h from rnndb
From: Ben Skeggs <bskeggs at redhat.com> Signed-off-by: Ben Skeggs <bskeggs at redhat.com> --- src/gallium/drivers/nouveau/nv50/g80_defs.xml.h | 279 ++++++++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 src/gallium/drivers/nouveau/nv50/g80_defs.xml.h diff --git a/src/gallium/drivers/nouveau/nv50/g80_defs.xml.h
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat: you have NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) and you want NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly")) There must be something I am missing, because NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2)) appears to
2012 Dec 16
3
averaging X of specific Y (latitude)
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X) latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I would like to have the average range size of every degree of latitude. For example, the average range
2007 Dec 19
3
array addition
Hi suppose I have two arrays x1,x2 of dimensions a1,b1,c1 and a2,b2,c2 respectively. I want x = x1 "+" x2 with dimensions c(max(a1,a2), max(b1,b2),max (c1,c2)) with x[a,b,c] = x1[a1,b1,c1] + x2[a2,b2,c2] if a <=min(a1,a2) , b<=min (b1,b2), c<=min(c1,c2) and the other bits either x1 or x2 or zero according to whether the coordinates are "in range" for
2011 Mar 05
2
Repeating the same calculation across multiple pairs of variables
Hi all, I frequently encounter datasets that require me to repeat the same calculation across many variables. For example, given a dataset with total employment variables and manufacturing employment variables for the years 1990-2010, I might have to calculate manufacturing's share of total employment in each year. I find it cumbersome to have to manually define a share for each year and
2012 May 14
2
[LLVMdev] SIV tests in LoopDependence Analysis, Sanjoy's patch
On Mon, 14 May 2012 11:46:02 -0700 Preston Briggs <preston.briggs at gmail.com> wrote: > On Sat, Apr 21, 2012 at 6:08 AM, Sanjoy Das > <sanjoy at playingwithpointers.com> wrote: > > > > Sorry for having been quiet for so long, I have my university exams > > going on, and will be able to contribute only after the coming > > Friday. > > Gents, >
2010 Feb 18
1
aggregate by column names
Hi, I've this dataframe: V1 V5 V6 1 MOD13Q1_2000049 0.1723 A1 2 MOD13Q1_2000049 0.1824 B1 3 MOD13Q1_2000049 0.1824 C1 4 MOD13Q1_2000049 0.1774 A2 5 MOD13Q1_2000049 0.1953 B2 6 MOD13Q1_2000049 0.1824 C2 7 MOD13Q1_2000065 0.1921 A1 8 MOD13Q1_2000065 0.1938 B1 9 MOD13Q1_2000065 0.2009 C1 10 MOD13Q1_2000065 0.2035 A2 11 MOD13Q1_2000065 0.2157 B2 12
2005 Apr 20
1
newby trying to solve a system
Dear R-gurus, being very new to R, (as well as lazy and not too smart !) I have some problems (and get lost in the docs) trying to write something to find the 9 values (A1,B1,C1,A2,B2,C2....C3) which are solutions of a 12 equations system of the form : > x1-(A1/(A1+B1+C1)) = 0 > y1-(B1/(A1+B1+C1))= 0 > z1-(C1/(A1+B1+C1)) = 0 > 3 same equations with subscript 2 > 3 same
2007 Oct 27
1
having problems re-ordering a dataframe
Dear R users, I need to reorder a dataframe using 3 variables for the determine the sorting order. When I create a simple dataframe to test the method, things work as I expected: a1 <- rep(1:10, each=8) a2 <- rep(rep(1:2, each=4), 10) a3 <- rep(c(1:4),20) (a <- data.frame(a1, a2, a3)) for each combination of a1 and a2, a3 is increasing t <- order(a$a1, a$a2, rev(a$a3)) b