Displaying 20 results from an estimated 20000 matches similar to: "rbind question"
2003 Jul 15
2
matrix manipulations
Hi
cor(x,apply(x,1,sum)) gives me the correlations of each column with the sums of each row (correct me if I'm wrong, please).
What I need are the correlations of each column with the sums of each row except the entry in the given column. It seems that for any one column i I get it by doing:
cor(x[,i],apply(x[,-i],1,sum))
But I struggle to get it for all the columns. I was trying things
2003 Jul 08
4
how to rename rows/columns of a matrix?
Hi
I get a matrix with the columns named like "X13 X22 X1 X14 ...", i.e. not
successively. That has it's good reasons, but now how can I rename the
columns to "X1 X2 X3 ..."?
Thanks a lot,
David
2004 Mar 09
2
use of split lines in ess
Hi all
I am very astonished that R generates a "syntax error" when I want to
split up a line with a backslash, which usually works in any shell script.
R itself generates the "+" symbols at the beginning of following lines
in a splitted line so I've tried with them as well, but also without
success.
Searching in the h-help archive did not reveal any answer either.
2004 Mar 18
2
character -> list
Hi
I have a matrix of type "character" (strangly) and am trying to apply
the function "aggregate" to it, but unfortunately without success.
It seems to me that aggregate would work, if I only could get rid of the
quotation marks around each item.
So for a very simple example which looks as my actual data look (of
course here I put the quotation marks on purpose, but I have
2003 Jun 17
1
How to generate a pairwise non-parametric comparison table?
Dear list
I am comparing the results of several different experimental setups. With kruskal.test() I can test if there is any difference at all in any of them, if I understand it correctly. But now, when there is a difference, how do I generate a (half-) table of pairwise comparisons, using e.g. wilcox.test(), to find the ones where the difference actually occurs.
I guess I don't have to
2003 Dec 04
6
get mean of several rows
Dear all!
After hours of trying around, I gave up:
I have a 2-dimensional array, and I know how to split it into its rows
and how to get the mean for every row using 'sapply'.
But what I want is to calculate the mean over the first n rows, and then
the second n rows, etc., so that I get a vector like:
v == mean1(row 1:5), mean2(row6:10),...
(trivial, you might say. I find it rather
2002 Oct 31
7
Symbols for male/female
Dear all,
I would like to use the biological symbols for male and female as plotting
symbols in a scatterplot (ideally filled and non-filled). R does not seem
to have these symbols using pch= in plot() nor are they implemented via
expression() or at least I did not find them. I found that the symbols are
e.g. available in the wasysym and the marvosym package in LaTeX.
I have coded two very rough
2002 Oct 31
7
Symbols for male/female
Dear all,
I would like to use the biological symbols for male and female as plotting
symbols in a scatterplot (ideally filled and non-filled). R does not seem
to have these symbols using pch= in plot() nor are they implemented via
expression() or at least I did not find them. I found that the symbols are
e.g. available in the wasysym and the marvosym package in LaTeX.
I have coded two very rough
2003 Nov 25
3
plot mean + S.E. over time
Hi, there!
I finally became a disciple of 'R', after having lost years of my life
handling data with a popular, rather wide-spread spreadsheet-software.
Now I want to plot the results of many runs of my simulation over time,
so that the means +/- Standard error are on the y-axis, and time on the
x-axis.
I have tried 'boxplot', with timesteps as the grouping variable, but did
2009 Feb 12
5
Extending each element in a list, or rbind()-ing arrays of different length without recycling
Hi,
I'm trying to take a matrix such as
[,1] [,2] [,3] [,4] [,5]
[1,] 2 7 2 7 9
[2,] 10 10 6 8 6
[3,] 1 9 7 2 0
and generate a new matrix which contains only the unique values in each row:
[,1] [,2] [,3] [,4] [,5]
[1,] 2 7 9 NA NA
[2,] 10 6 8 NA NA
[3,] 1 9 7 2 0
My problem is that I can use
2006 Jan 27
1
Classifying Intertwined Spirals
I'm using an SVM as I've seen a paper that reported extremely good
results. I'm not having such luck. I'm also interested in ideas for
other approaches to the problem that can also be applied to general
problems (no assuming that we're looking for spirals).
Here is my code:
library(mlbench)
library(e1071)
raw <- mlbench.spirals(194, 2)
spiral <-
2004 Dec 13
2
lists within a list / data-structure problem
Dear all,
this is a rather basic question; i am not sure how to structure my data
well:
I want to extraxt various measures from my raw-data. These measures are
of different sizes, so I decided to store them in a list, like:
run1 <- list(Dom = (my_vector), mean = (my_single_number))
I can do that in a for loop for 40 runs, ending up with 40 lists: run1,
run2, ..., run40.
To have all the
2010 Oct 14
1
rbind ing matrices and resetting column numbers
Sorry for the verbose example. I want to row bind two matrices, and all works except I want the column labelled "row" to be sequential in the new matrix, shown as "mat3" here, i.e. needs to be 1:6 and not 1:3 repeated twice. Any suggestions?
Thanks
J
> colnm1 <- c("row","ti","counti")
> colnm2 <-
2004 Oct 04
7
Strange Matrix Multiplication Behaviour
Hi there fellow R-users,
Im seeing some strange behaviour when I multiply a vector by a matrix
Here is my script:
> tr
1 2 3 4 5 6
0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667
>
> ex1
a b c d e f
1 0.2309579 -3.279045 -0.6694697 -1.1024404 0.2303928 -1.5527404
2
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2009 Feb 25
8
learning R
I was wondering why the following doesn't work:
> a=c(1,2)
> names(a)=c("one","two")
> a
one two
1 2
>
> names(a[2])
[1] "two"
>
> names(a[2])="too"
> names(a)
[1] "one" "two"
> a
one two
1 2
I must not be understanding some basic concept here.
Why doesn't the 2nd name change to
2011 Aug 29
4
parallel rbind
As I am sitting here waiting for some R scripts to run...I was
wondering... is there any way to parallelize rbind in R?
I wait for this call to complete frequently as I deal with large
amounts of data.
do.call("rbind", LIST)
2002 Nov 27
6
Rbind help needed
Dear list
I have a very simple question which is causing me problems!
I have a matrix A and simply want to rbind this matrix together n times (n is a large number)
How can I write this in R?
I know I could do new<-rbind(z,z,z,...z) with z written n times but this will take forever as n is so large.
Is there a simple way to write this?
Cheers
Mick
2004 Apr 30
2
rbind with missing columns
Hello,
I have several data sets, which I want to combine column-by-column using
"rbind" (the data sets have ~100 columns). The problem is, that in some
data sets some of the columns are missing.
Simply using rbind gives me:
"Error in match.names(clabs, names(xi)) : names don't match previous
names"
Is there a simple way to make R do the rbind despite the missing columns
2009 Jan 07
5
rbind for matrices - rep argument
Dear R users,I'm facing a trivial problem, but I really can't solve it. I've
tried a dozen of codes, but I can't get the result I want.
The question is: I have a dataframe like this one
[,1] [,2] [,3] [,4] [,5]
[1,] 1 2 3 4 5
[2,] 2 5 5 4 9
[3,] 1 6 8 1 2
[4,] 8 6 4 1 5
made up of decimal numbers, of course.
I want to