Displaying 20 results from an estimated 111 matches for "gundala".
2008 Jun 24
5
Measuring Goodness of a Matrix
...matrices A and B.
And I want to measure how good each of this matrix is.
So I intend to compare A and B with another "gold standard"
matrix X. Meaning the more similar a matrix to X the better it is.
What is the common way in R to
measure matrix similarity (ie. A vs X, and B vs X) ?
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 13
3
Returning Non-Unique Index with Which (alternatives?)
..., "AAG", "ATA", "ATT")
> qr <- c("AAC", "ATT", "ATT")
> which(repo%in%qr)
[1] 3 6
Note that the query contain repeating elements, yet
the output of which only returns unique.
How can I make it returning
[1] 3 6 6
instead?
- Gundala Viswanath
Jakarta - Indonesia
2008 Jul 07
4
Plot Mixtures of Synthetically Generated Gamma Distributions
...x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6))
I want to plot the density curve of X, in a way that it shows
a distinct 3 curves that represent each component.
How can I do that?
I tried this but doesn't work:
lines(density(x))
Please advise.
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 06
5
Changing Matrix Header
...3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 0 0 0 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0 0 0 1
[3,] 0 0 0 0 0 0 0 0 0 2
I tried:
> as.matrix(x)
But failed.
- Gundala Viswanath
Jakarta - Indonesia
2008 Aug 01
3
Grouping Index of Matrix Based on Certain Condition
...0.05204063
[3,] 8.923553e-01 0.10764474
[4,] 9.295003e-01 0.07049966
[5,] 8.880434e-01 0.11195664
[6,] 9.197367e-01 0.08026327
[7,] 9.431232e-01 0.05687676
[8,] 9.460356e-01 0.05396442
[9,] 6.053829e-01 0.39461708
[10,] 9.515173e-01 0.04848268
Is there a simple way to do it in R?
- Gundala Viswanath
Jakarta - Indonesia
2008 Sep 09
3
Splitting Data Frame into Two Based on Source Array
...ource array:
> src
[1] "bar" "pox"
and the other one the complement.
In the end we hope to get this two dataframes:
> data_child1
V1 V2
bar 13.1
pox 8.21
and
> data_child2_complement
foo 13.1
qux 10.4
cho 20.33
Is there a compact way to do it in R?
- Gundala Viswanath
Jakarta - Indonesia
2008 Jun 23
3
Getting only label column of a data frame
...21.4 32.4 49.7 51.3 58.3 58.9
11097 59.5 65.9 117.5 118.0 118.9 122.5 126.3 156.5 157.0
I want to get the label (first) column only:
11145
3545
8951
11097
Is there a quick way to achieve that?
I tried this but fail:
mylable <- dataf[,1]
Please advice.
- Gundala Viswanath
Jakarta - Indonesia
2008 Dec 22
3
Convert ASCII string to Decimal in R (vice versa) was: Hex
Hi Dieter,
Sorry my mistake. I wanted to convert them
into Decimal (not Hexadecimal).
Given this string, the desired answer follows:
> ascii_str <- "ORQ>IK"
79 82 81 62 73 75
> ascii_str2 <- "FDC"
70 68 67
- Gundala Viswanath
Jakarta - Indonesia
On Mon, Dec 22, 2008 at 5:49 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
> Gundala Viswanath <gundalav <at> gmail.com> writes:
>
>> For example I have the following ASCII strings:
>>
>> > ascii_str <- &q...
2009 Feb 26
3
Modifying Names from (x,y] into x
Hi,
I have the following data that looks like this:
> names(dat)
[1] "(-2329,-2319]" "(-1399,-1389]" "(-669.4,-659.4]"
How can I modify those names into just this?
[1] -2329 -1399 -669.4
- Gundala Viswanath
Jakarta - Indonesia
2008 Aug 01
2
Storing Matrices into Hash
...,] 9.892886e-01 0.010711437
[4,] 9.931660e-01 0.006833979
[5,] 9.149391e-01 0.085060890
This method I have is not favorable
because it just stack the matrices together as another matrix.
Makes it hard to get individual matrix later.
all_mat <- NULL
all_mat <- c(all_mat, mat1,mat2)
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 11
3
Converting Numerical Matrix to List of Strings
...f vector ( = 4).
3. Character "a" encode as "0",
"c" -> "1",
"g" -> "2",
"t" -> "3"
Length of strings are assumed to be uniform within the vector,
and it can be greater than 3 (up to 40 characters).
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 09
4
Extracting File Basename without Extension
Dear all,
The basename() function returns the extension also:
> myfile <- "path1/path2/myoutput.txt"
> basename(myfile)
[1] "myoutput.txt"
Is there any other function where it just returns
plain base:
"myoutput"
i.e. without 'txt'
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 09
3
Pack and Unpack Strings in R
...a;
# Store the compressed bit into array
push @data, $compressed;
# process the array
foreach my $dat ( @data ) {
my $decompressed = unpack 'b*', $dat;
$decompressed =~ s/(..)/$digmap{$1}/ge;
print "$decompressed\n";
# or do further processing on $dat
}
__END__
- Gundala Viswanath
Jakarta - Indonesia
2008 Jun 23
2
Pairwise Partitioning of a Vector
...exp)) {
sp_b <- pose+1
sp_e <- ncol(gexp)
# This two doesn't do what I want
part1 <- sort.gexp[posb:pose]
part2 <- sort.gexp[sp_b:sp_e]
# we later want to process part1 and part2 separately
}
}
}
__END__
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 13
3
Extracting Hash via Vector
...> q <- c("some", "more", "not_there")
But why this failed?
> extracted <- x[[q]]
Error in x[[q]] : subscript out of bounds
we expect the output of 'extracted' to be
a vector as well. When the key is not present
to give "NA" in vector
- Gundala Viswanath
Jakarta - Indonesia
2009 Jan 16
5
Value Lookup from File without Slurping
...ery above,
yielding:
0.02
0.7
However, I want to avoid slurping whole repo.txt into an object (e.g. hash).
Is there any ways to do that?
The reason I want to do that because repo.txt is very2 large size
(milions of lines,
with tag length > 30 bp), and my PC memory is too small to keep it.
- Gundala Viswanath
Jakarta - Indonesia
2008 Jul 10
2
Finding Values that Occur Most Often in a Vector
Hi,
Is there a way to do it?
For example I have the following vector:
> print(myvector)
> [1] -295.8045 -295.8045 -295.8045 -295.8045 -325.4754 -295.8045 -295.8045
[8] -295.8045 -413.2099 -295.8045
I want it to return -295.8045, which occur most often.
- Gundala Viswanath
Jakarta - Indonesia
2008 Sep 05
2
Package for Tidying-up R-code
Dear all,
Is there any such package?
I am thinking of something equivalent to Perl::Tidy.
For example with VI editor one can visual highlight a portion
of Perlcode and then issue the command:
!perltidy
then the code will be automatically arranged.
- Gundala Viswanath
Jakarta - Indonesia
2008 Dec 21
3
Globbing Files in R
Dear all,
For example I want to process set of files.
Typically Perl's idiom would be:
__BEGIN__
@files = glob("/mydir/*.txt");
foreach my $file (@files) {
# process the file
}
__END__
What's the R's way to do that?
- Gundala Viswanath
Jakarta - Indonesia
2008 Dec 24
2
Using 'cat' on data frame
...07
2 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC 14
3 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT 3
But why when printint it using 'cat', it doesn't print
the desired string "AAA" ?
> cat(raw.count$Var1, "\n")
1 2 3
What's wrong with my cat command above.
- Gundala Viswanath