Hi,
Thanks again for your help with this. I would like to use a variation of
this function in a similar dataset (numeric) with elements separated by a
comma e.g.
dat <- read.table(tc <- textConnection(
'0,1 1,3 40,10 0,0
20,5 4,2 10,40 10,0
0,11 1,2 120,10 0,0'), sep="")
to simply calculate th
Hello,
I have an example file which can be generated using:
dat <- read.table(tc <- textConnection(
'T T,G G T
C NA G G
A,T A A NA'), sep="")
I also have a reference file with the same number of rows, for example:
G
C
A
I would like to transform the file to numerical values using the followin
online course that would be helpful for
learning these sorts of data handling functions?
Thanks again!
--- On Fri, 8/10/10, Jeffrey Spies-2 [via R]
wrote:
From: Jeffrey Spies-2 [via R]
Subject: Re: function using values separated by a comma
To: "burgundy"
Date: Friday, 8 October, 2
Hello,
I have a dataframe (tab separated file) which looks like the example below -
two values separated by a comma, and tab separation between each of these.
[,1] [,2] [,3] [ ,4]
[1,] 0,1 1,3 40,10 0,0
[2,] 20,5 4,2 10,40 10,0
[3,] 0,11 1,2 120,10 0,0
I would like to calculat
Hi,
I'm trying to replace all values equal to 1 in one file (a) with the value
in the corresponding column in a separate file (b). Example below.
Any help (and brief notes if poss) much appreciated. Thanks!!
file a:
0,0,1,1,0
1,0,0,0,1
0,0,0,0,0
1,0,1,1,0
file b:
3,4,6,8,11
output request:
0,
Hi,
I'm trying to generate a distance matrix between sample pairs (example
below). I'm not very familiar with the loop command which I expect I will
need for this. The example below demosntrates what I'd like to get out of
the data - essentially, to calculate the proportion of positions where two
Thanks for advice, sorted now!
From: Owe Jessen-2 [via R]
Sent: Fri, 9 April, 2010 18:39:53
Subject: Re: How to replace all non-maximum values in a row with 0
Am 09.04.2010 10:04, schrieb burgundy:
> Hi,
>
> I would like to replace all the max v
o}
r
}
# Test:
> t(apply(A, 1, f))
[,1] [,2] [,3] [,4] [,5]
[1,]00001
[2,]00001
[3,]00100
[4,]00000
HTH,
Dennis
On Fri, Apr 9, 2010 at 1:04 AM, burgundy <[hidden email]> wrote:
>
&
Hi,
I'm using the hist function to plot the frequency of 21 variables, but it
keeps starting the x-axis from 0 and adding variables 1 and 2 together (all
other vairables have the correct frequencies). I suspect it adds 1 and 2
together so that 0 can fit in with demarcations at intervals of 5. Usi
Hi,
I'm trying to assign a score to each row which allow me to identify which
rows differ. In the example file below, I've used "," to indicate column
separators. In this example, I'd like to identify that row 1 and row 5 are
the same, and row 2 and row 4 are teh same.
Any help much appreciated.
Hello,
I'm trying to replace cells with value 1 with the number of the column.
Example below.
Thank you!
from:
0,1,0,1
0,0,0,1
1,0,0,1
to:
0,2,0,4
0,0,0,4
1,0,0,4
--
View this message in context:
http://n4.nabble.com/replace-cells-with-column-number-tp1838289p1838289.html
Sent from the R h
Hi,
I would like to replace all the max values per row with "1" and all other
values with "0". If there are two max values, then "0" for both. Example:
from:
2 3 0 0 200
30 0 0 2 50
0 0 3 0 0
0 0 8 8 0
to:
0 0 0 0 1
0 0 0 0 1
0 0 1 0 0
0 0 0 0 0
Thanks!
--
View
12 matches
Mail list logo