Displaying 20 results from an estimated 20000 matches similar to: "Combine matrix"
2008 Dec 01
1
Help with lattice graphics
Hi,
I like the formatting and the appearance of lattice plots. But I have not succeeded in gettting the right format in my plots with the lattice package in one of my applications. In?the code shown below, I start by constructing a general data frame and show my attempts with the lattice package commands. After that, I use the graphics package and show the kind of plot that I want to get.
I would
2007 Aug 20
1
Q: combine 2 data frames with missing values
Een ingesloten tekst met niet-gespecificeerde tekenset is
van het bericht gescrubt ...
Naam: niet beschikbaar
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070820/920567a6/attachment.pl
2009 Jun 20
1
how to apply the dummy coding rule in a dataframe with complete factor levels to another dataframe with incomplete factor levels?
Dear R helpers:
Sorry to bother for a basic question about model.matrix.
Basically, I want to apply the dummy coding rule in a dataframe with
complete factor levels to another dataframe with incomplete factor levels.
I used model.matrix, but could not get what I want.
The following is an example.
#Suppose I have two dataframe A and B
2013 Sep 05
2
binary symmetric matrix combination
Hi,
May be this helps:
m1<- as.matrix(read.table(text="
y1 g24
y1 0 1
g24 1 0
",sep="",header=TRUE))
m2<-as.matrix(read.table(text="y1 c1 c2 l17
?y1 0 1 1 1
?c1 1 0 1 1
?c2 1 1 0 1
?l17 1 1 1 0",sep="",header=TRUE))
m3<- as.matrix(read.table(text="y1 h4??? s2???? s30
?y1 0 1 1 1
?h4 1 0 1 1
?s2 1 1 0 1
?s30 1 1 1
2008 Mar 18
1
problem with merge
I have used merge regularly and thought I understood how it worked, but
I must not. I have two dataframes with identical colnames from two
different experiments, TL01 and LC01. Each dataframe has a column named
"Entrez.Gene", which I have converted to "as.character" just to make
sure merge is not looking at factor levels. Because I have done some
filtering, the Entrez.Gene
2010 Mar 15
1
inner join sqldf
Hi,
I have two dataframes that have some common columns. I would like to join
them by the common columns prochi and prescribed_date as there are duplicate
prochis but they will be made unique by date. I tried doing an inner join
but that just duplicated the columns whereas I would like the information
from the test_sql_tsf to fill the NAs in the test_sql_psd common columns.
require(sqldf)
2012 May 10
2
Combine two tables by row with different columns
Hi R user,
I could not combine two tables. Would any one help me on how I can combine with following example tables?
> T1
X Y Z XX
A 1 5 9 13
B 2 6 10 14
C 3 7 11 15
D 4 8 12 16
> T2
X Y XX
a 1 4 7
b 2 5 8
c 3 6 9
I want to get the following table
cT
X Y XX
A 1 5 13
B 2 6 14
C 3 7 15
D 4 8 16
A1 1 4 7
B1 2 5 8
C1 3 6 9
Thanks for your help.
Thanks,
Kristi
===
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP)
According to the documentation, rownames and colnames are character vectors.
Assigning a vector of class POSIXct or POSIXlt as rownames or colnames
therefore is not strictly according to the rules.
In some cases, R performs a reasonable typecast, but in some other cases
where the same typecast also would be possible, it does not.
Assigning a
2006 Mar 21
1
rownames, colnames, and date and time
I noticed something surprising (in R 2.2.1 on WinXP)
According to the documentation, rownames and colnames are character vectors.
Assigning a vector of class POSIXct or POSIXlt as rownames or colnames
therefore is not strictly according to the rules.
In some cases, R performs a reasonable typecast, but in some other cases
where the same typecast also would be possible, it does not.
Assigning a
2007 Nov 26
2
colnames slow (PR#10470)
Full_Name: Tomas Larsson
Version: 2.6.0
OS: Windows XP
Submission from: (NULL) (198.208.251.24)
This is not a bug, it is a performance issue but I think it should have an easy
fix.
I have a large matrix (about 2,000,000 by 20), when I type colnames(x) it takes
a long time to get the result. However, if I select just the first couple of
rows of the matrix I don't have to wait for the
2004 Aug 20
3
Loss of rownames and colnames
Hi,
I am working on some microarray data, and have some problems with
writing iterations.
In essence, the problem is that objects with three dimensions don't
have rownames and colnames. These colnames and rownames would
otherwise still be there in 2 dimensional objects.
I need to generate multiple iterations of a 2 means-clustering
algorithm, and these objects thus probably need 3
2011 Apr 20
2
get cells by the combination of their column and row names
Hi,
I have a (correlation) matrix and I want to select a subset of its cells depending on the combination of their column and row names.
This illustrates my problem: mtrx <- matrix(c(1,2,3,4,5,6,7,8,9), nrow=3, ncol=3, dimnames = list(c('c132','c432', 'c233'), c('r132','r233', 'r432')))> mtrx r132 r233 r432c132 1 4 7c432 2
2006 Jul 03
1
rownames, colnames, and date and time
Hi all
I was wondering whether there has ever been an update on the rownames and
colnames behaviour as described by Eric below?
I still get the same behaviour, exactly as described by Eric, on my WinXP
installation of R-2.3.0. I also posted a message to r-help on Friday but
looking through the online archives it seems to have not made it to the
list. I would agree with Eric that a consistent
2020 Oct 08
1
Lahman Baseball Data Using R DBI Package
This is really a feature of SQL, not R. SQL requires that you double quote
column names that start with numbers, include spaces, etc., or that are SQL
key words. E.g.,
> d <- data.frame(Order=c("sit","stay","heel"),
Where=c("here","there","there"), From=c("me","me","you"))
>
2017 Jan 19
2
Error en loop anidado con data.table
Hola tengo una tabla de tipo data.frame "datos" con la siguiente
estructura, simplificada en número de niveles por variable, para crear un
ejemplo más sencillo:
id anio t_8a t_10a t_12a rankf8 rankf10 rankf12
1 1 100 220 220 NA NA NA
2 1 140 350 350 NA NA NA
3 2 55 165 165 NA NA NA
4 2 60 200 200 NA NA NA
5 2 100 NA NA NA NA NA
6 3 NA 350 350 NA NA NA
También tengo una matriz,
2010 Mar 19
5
Merging Matrices
I have two symmetric matrices, but of different dimensions. The entries are
identified by specific labels some of which are shared by both matrices. I
would like to sum the two matrices, but retain the union of the two. In
other words, I want the result to be the same size as the larger of the two
matrices, but with the entries that they share added together.
cbind() and rbind() don't
2006 May 30
2
merging
Dear List,
Given,
y <- matrix(c(0,1,1,1,0,0,0,4,4), ncol = 3, byrow = TRUE)
rownames(y) <- c("a","b","c")
colnames(y) <- c("1","2","3")
y
y2 <- y[2:3, ]
rownames(y2) <- c("x","z")
y2
how can I stop
merge(y, y2, all = TRUE, sort = FALSE)
squishing the extra rows? Ideally I want the same as:
rbind(y,
2006 Sep 14
1
R-devel: rownames of a data.frame
Hello!
Data.frames have new rownames funcionality, however in use of colnames<-
in R-devel "changes" this. Here is the example:
> df1 <- data.frame(letters[1:5])
> attributes(df1)
$names
[1] "letters.1.5."
$row.names
[1] 1 2 3 4 5
$class
[1] "data.frame"
> colnames(df1) <- "bla"
> attributes(df1)
$names
[1] "bla"
2010 Nov 01
1
sqldf error only on Unix not Windows
Hello Group,
I am having trouble with the sqldf package on unix. The same code works fine on windows.
Silly Example script:
# Load the package
library(sqldf)
# Use the titanic data set
data(women)
colnames(women)
head(women)
sqldf('select height, count(*) from women where height is not null group by weight')
Unix Output and error:
bash-3.00$ R --vanilla <testR.R
2004 Jul 30
2
pairwise difference operator
There was a BioConductor thread today where the poster wanted to find
pairwise difference between columns of a matrix. I suggested the slow
solution below, hoping that someone might suggest a faster and/or more
elegant solution, but no other response.
I tried unsuccessfully with the apply() family. Searching the mailing
list was not very fruitful either. The closest I got to was a cryptic
chunk