[R] Random Integer Number in Uniform Distribution

2010-10-25 Thread Gundala Viswanath
Is there a way to do it? At best what I can achieve is non integer: runif(10, min=1, max=100) [1] 51.959151 56.654146 63.630251 3.172794 4.073018 11.977437 86.601869 [8] 75.788618 11.734361 6.770962 -G.V. __ R-help@r-project.org mailing list

[R] Normalizing Vector with Negative Numbers

2010-09-26 Thread Gundala Viswanath
Dear expert, I have a series of number that looks like this x - c(-0.005282, 0.000314, 0.002851, -2.5059217162, -0.007545, -1.0317758496, 0.001598, -1.2981735068, 0.072411) How can I normalize it in R so that the new numbers is ranging from 0 to 1 ? - G.V.

[R] What's the meaning of Species ~ . in IRIS data

2010-09-29 Thread Gundala Viswanath
I am refering to a function call like this: data(iris) x - svmlight(Species ~ ., data = iris) I tried to see the content of it by typing: Species ~ . but it gives nothing. How can I see it's content ? - P.Dubois __ R-help@r-project.org mailing

[R] How to get a proportion of a Vector Member

2010-09-29 Thread Gundala Viswanath
I have a vector that looks like this: foo [1] o o o x o o o o o x x o x How can we find the percentage of o and x in that vector in R? - G.V __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Accessing Vector of A Data Frame

2010-09-29 Thread Gundala Viswanath
I have a variable that looks like this: print(pred$posterior) ox 1 2.356964e-03 9.976430e-01 2 8.988153e-01 1.011847e-01 3 9.466137e-01 5.338627e-02 4 2.731429e-11 1.00e+00 Now what I want to do is to access o and x How come this approach fail?

[R] Accessing Element of a Table

2010-10-01 Thread Gundala Viswanath
I have the following structure: str(propn) table [1:2(1d)] 0.674 0.326 - attr(*, dimnames)=List of 1 ..$ label: chr [1:2] o x print(propn) label o x 0.6738347 0.3261653 How can I access the value of o and x I tried this but fail print(propn$label[,o]; - G.V.

[R] How To Extract Row from A Data Frame

2010-10-03 Thread Gundala Viswanath
I have a data frame that looks like this: print(df) V2 V3 V4 V5 V6 V7 V8 V9V10V11V12 1 FN 8.637 28.890 31.430 31.052 29.878 33.215 32.728 32.187 29.305 31.462 2 FP 19.936 30.284 33.001 35.100 30.238 34.452 35.849 34.185 31.242 35.635 3 TN 0.000 17.190

[R] Creating DataFrame of Vectors Data Structure for Classification

2010-07-05 Thread Gundala Viswanath
Dear Experts, I have a input file that looks like this -0.438185,svm,1 -0.766791,svm,1 0.695282,svm,-1 0.759100,svm,-1 0.034400,svm,1 0.524807,svm,1 -0.27647800,nn,1 -0.16120810,nn,-1 0.63911350,nn,1 0.400554110,nn,1 0.429192240,nn,-1 0.454239140,nn,1 How can I create a data structure in R so

[R] How to Plot With Different Marker ( ‘x ’ and ‘o’) Based on Condition in R

2010-07-05 Thread Gundala Viswanath
Dear Expert, I have a data that looks like this: for_y_axis -c(0.49534,0.80796,0.93970,0.8) for_x_axis -c(1,2,3,4) count -c(0,33,0,4) What I want to do is to plot the graph using for_x_axis and for_y_axis but will mark each point with o if the value is equal to 0(zero) and with x if

[R] Conditional Splitting a Vectors into Two Vectors

2010-07-06 Thread Gundala Viswanath
Suppose I have two vectors of same dimensions: x -c(0.49534,0.80796,0.93970,0.8) count -c(0,33,0,4) How can I group the vectors 'x' into two vectors: 1. Vector `grzero` that contain value in x with `count` value greater than 0 and 2. Vector `eqzero` with value in x with

[R] Howto Smooth a Curve Created with the Point Function

2008-08-04 Thread Gundala Viswanath
can I resolve this problem? I specifically want to use the dgamma function with the learned parameter (alpha,beta). That's why I don't use this command: lines(density(x),add=T, col=red) - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org

[R] About Creating a List by Parsing Text

2008-08-05 Thread Gundala Viswanath
with the following construct __BEGIN__ comp.ll - model_all[grep(Gene .* k=.*, model_all)] print(comp.ll) patt - Gene \\d+ ([\\w-/]+) [\\w-]+ k= (\\d) LL= ([-]\\d+\.\\d+) nresk - unlist(strsplit(sub(patt, \\1 \\2 \\3,comp.ll,perl=TRUE), )) __END__ - Gundala Viswanath Jakarta - Indonesia

Re: [R] About Creating a List by Parsing Text

2008-08-05 Thread Gundala Viswanath
Thanks Jim, But how can I modify this line of yours y - lapply(split(x, x$V3), [[, 8) to suit my 'comp.ll' I tried this but fail: p - \tGene 11340 211952_at RANBP5 k= 1 LL= -970.692 y - lapply(split(p, p[3]), [[, 8) y list() - Gundala Viswanath Jakarta - Indonesia On Tue, Aug 5

[R] Extracting Names of Named List (Index of Hash)

2008-08-05 Thread Gundala Viswanath
in the end I want to get the array: [1] 200052_s_at 200071_at 200084_at - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] Iterating Named List

2008-08-05 Thread Gundala Viswanath
? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

[R] Replacing double-quote with backtick

2008-08-05 Thread Gundala Viswanath
Hi, How can I change the back quoted strings below print(x) [1] foo [1] bar into [1]`foo` [2]`bar` Because later I want to access a named list with this string: mylist$`foo` mylist$`bar` I can't do it with: mylist$foo mylist$bar - Gundala Viswanath Jakarta - Indonesia

[R] Usingloglikelihood to Infer which distributions fits best to data

2008-08-07 Thread Gundala Viswanath
,-881.6734428 Regards, Gundala Viswanath Jakarta-Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

[R] KS Test for Mixture of Distributions

2008-08-11 Thread Gundala Viswanath
temp=cbind(temp,pgamma(x,shape=al[j],scale=be[j])) } temp=t(lambda*t(temp)) as.vector(temp) } __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Binary Tree Testing in ape package (a bug?)

2008-09-03 Thread Gundala Viswanath
Was that a bug in APE package? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

[R] Package for Tidying-up R-code

2008-09-05 Thread Gundala Viswanath
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

[R] Splitting Data Frame into Two Based on Source Array

2008-09-08 Thread Gundala Viswanath
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 __ R-help@r-project.org mailing list https

[R] Scaling X axis from -1 to 1

2008-09-14 Thread Gundala Viswanath
Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Converting EnSeMBL Probe names into Gene Name

2008-09-18 Thread Gundala Viswanath
Dear all, Is there a way with Bioconductor in which I can convert such EnSemBL probe names into the standard gene names? AFFX-M27830_5_at AFFX-M27830_M_at ENSG003_at ENSG005_at ENSG419_at - Gundala Viswanath Jakarta - Indonesia

[R] Concat Multiple Plots into one PNG figure

2008-06-10 Thread Gundala Viswanath
PNG figure xyplot(dat.pca$x[,1] ~ dat.pca$x[,2], xlab=First Component, ylab=Second Component) xyplot(dat.pca$x[,2] ~ dat.pca$x[,3], xlab=Second Component, ylab=Third Component) dev.off() __END__ -- Gundala Viswanath __ R-help@r-project.org mailing list

[R] Concat Multiple Plots into one PNG figure

2008-06-10 Thread Gundala Viswanath
PNG figure xyplot(dat.pca$x[,1] ~ dat.pca$x[,2], xlab=First Component, ylab=Second Component) xyplot(dat.pca$x[,2] ~ dat.pca$x[,3], xlab=Second Component, ylab=Third Component) dev.off() __END__ -- Gundala Viswanath -- Gundala Viswanath __ R-help@r

[R] Finding Coordinate of Max/Min Value in a Data Frame

2008-06-11 Thread Gundala Viswanath
the coord of maximum value is (RW,PC2) = 0.865, and coord of min value is (CW,PC2) = - 0.288. -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Finding Coordinate of Max/Min Value in a Data Frame

2008-06-11 Thread Gundala Viswanath
Thanks so much both. - Gundala On 6/11/08, Henrique Dallazuanna [EMAIL PROTECTED] wrote: Try this: which(pca == min(pca), arr.ind = TRUE) which(pca == max(pca), arr.ind = TRUE) On Wed, Jun 11, 2008 at 7:34 AM, Gundala Viswanath [EMAIL PROTECTED] wrote: Hi, Suppose I have

[R] Default Argument Passing in Script

2008-06-11 Thread Gundala Viswanath
would be: my $param = $ARGV[0] || default_argument; I am wondering how can this be done in R. -- Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Data.matrix fail to convert data.frame into matrix

2008-06-11 Thread Gundala Viswanath
V4V5V6V7V8 10354 803.1 1107.8 431.6 349.8 386.7 646.3 744.2 620.9 __END__ I expect gexp.arr to be a plain vector (numeric). What's wrong with my code above? -- Gundala Viswanath Jakarta-Indonesia __ R-help@r-project.org mailing

[R] Regex for Special Characters under Grep

2008-06-12 Thread Gundala Viswanath
], .softR, sep=) # my regex construction cat(temp[-grep(^[\^\!\#],temp,perl=TRUE)], file=data_for_R, sep=\n) dat - read.table(data_for_R) ___END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Separator with | for read.table

2008-06-15 Thread Gundala Viswanath
a wrong parsing. Please advice. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

Re: [R] Separator with | for read.table

2008-06-15 Thread Gundala Viswanath
='' in the read.table. On Sun, Jun 15, 2008 at 9:11 PM, Gundala Viswanath [EMAIL PROTECTED] wrote: Hi, I have the following data file to be parsed and captured as a data frame: __DATA__ #GDS_ID GENE_NAME GENE_DESCRIPTION GENE_FUNCTION 1007_s_at | DDR1 | discoidin domain receptor tyrosine kinase 1

[R] Creating a Hash from Data.Frame

2008-06-15 Thread Gundala Viswanath
to create a hash with V2 as Key and V3 as its value? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] Superimposing Line over Histogram in Density Plot

2008-06-16 Thread Gundala Viswanath
Hi, Currently I have a density plot generated with this snippet. Is there a way I can add a line curve on top of it? I mean in one figure __BEGIN__ myhist - hist(x col=blue, main = Density Plot, xlab = Exp Level, ) __END__ - Gundala

[R] Resizing Stacked Figures

2008-06-16 Thread Gundala Viswanath
)) dev.off() __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

[R] Howto Compute Pairwise Similarity/Correlation Matrix from a Data Frame

2008-06-18 Thread Gundala Viswanath
) for (rwx in 1:nofrow) { print(data[rwx,]) for (rwy in 1:nofrow) { print(data[rwy,]) thecor - cor(data[rwx,],data[rwy.], method=pearson) # not sure how to proceed from here. } } __END__ Please advice. - Gundala Viswanath Jakarta - Indonesia

Re: [R] Howto Compute Pairwise Similarity/Correlation Matrix from aData Frame

2008-06-18 Thread Gundala Viswanath
) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Error: cannot allocate vector of size 3.7 Gb Execution halted __END__ - Gundala Viswanath Jakarta - Indonesia On Wed, Jun 18, 2008 at 4:39 PM, Dimitris Rizopoulos [EMAIL PROTECTED] wrote: try this: mat.data

[R] Create Matrix from Loop of Vectors, Sort It and Pick Top-K

2008-06-19 Thread Gundala Viswanath
gexvar - var(gex) # join variance with its original vector nvec - c(gexvar,gex) # I'm stuck here.This doesn't seem to work all.arr - data.frame(nvec) } print(all.arr) __END__ -- Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org

[R] Howto access V-base only column in a data frame

2008-06-19 Thread Gundala Viswanath
)? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] Howto reduce number of ticks in X, Y axis while still containing all the data

2008-06-19 Thread Gundala Viswanath
# Corr contains 100x100 matrix corr - cor(t(mat.data), method =pearson) # Plot them levelplot(corr, main=PCC of Top-100 Genes, xlab=Gene, ylab=Gene, scale=list(y=list(tick.number=10)) # Doesn't work ) - Gundala Viswanath Jakarta

Re: [R] Howto reduce number of ticks in X, Y axis while still containing all the data

2008-06-20 Thread Gundala Viswanath
1.00 Can you suggest how can I over come this problem? - Gundala Viswanath Jakarta - Indonesia On Fri, Jun 20, 2008 at 3:38 PM, Dieter Menne [EMAIL PROTECTED] wrote: Gundala Viswanath gundalav at gmail.com writes: I am trying to plot 100 x 100 matrix data in a level plot

[R] Getting only label column of a data frame

2008-06-22 Thread Gundala Viswanath
to achieve that? I tried this but fail: mylable - dataf[,1] Please advice. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] Columnwise Alternate Subsetting of a Data Frame

2008-06-22 Thread Gundala Viswanath
based on V2,V4,V6 ... (even) and V3, V5, V7 ..(odd) in the original data frame 3. Meanwhile keep row names and V1 in two newly formed data frames. Is there a compact way to do it? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing

[R] Pairwise Partitioning of a Vector

2008-06-23 Thread Gundala Viswanath
later want to process part1 and part2 separately } } } __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] How to access data structure (List of List)

2008-06-23 Thread Gundala Viswanath
..$ part2: num [1:76] 73.0 75.0 83.9 93.1 97.6 ... My question are: 1. What kind of data structure is it? List of List? 2. How can I access it's element? I tried the following loop but seem to fail for (i in 1:length(nw)) { print(nw[i]$part1) } Please advice. - Gundala Viswanath Jakarta

[R] How to return multiple values in a function

2008-06-23 Thread Gundala Viswanath
print(foo) print(bar) # how can I return foo and bar ? } # Is this the way to capture it? (nfoo,nbar) - myfunc(some_array) - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Gundala Viswanath
value thus in the end I hope to get something like: [1] 79.63 79.63 79.63 79.63 79.63 79.63 79.63 79.63 79.63 79.63 Is there a way to do it? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] Writing Vector to a File

2008-06-23 Thread Gundala Viswanath
=\n) I get this instead in my output.txt: 1 1 1 1 1 6241 6240 6240 1 6242 1 6242 6240 What's wrong with my command above? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Writing Vector to a File

2008-06-23 Thread Gundala Viswanath
Dear Philipp and Duncan, I've tried write(as.character(myvec), output.txt, sep=\n) and writeLines(as.character(myvec), output.txt, sep=\n) Both yielding same result. 1 1 1 1 1 6241 Is there any other possible explanation, why it still went wrong? - Gundala Viswanath Jakarta

[R] Accessing Named Column in a Matrix

2008-06-23 Thread Gundala Viswanath
(*, dimnames)=List of 2 ..$ : NULL ..$ : chr [1:80] ... But can't seem to make sense how to access var value. I've also tried with data$var But still fail to access var column - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org

[R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
,] 657.56857 3.396852e+04 [7,] 251.60519 1.239538e+03 [8,]78.53846 7.473607e+01 [9,] 140.37564 2.395830e+02 [10,] 358.13718 1.508718e+03 - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
Thanks Jim. That's does exactly what I am looking for. - Gundala Viswanath Jakarta - Indonesia On Tue, Jun 24, 2008 at 11:13 AM, jim holtman [EMAIL PROTECTED] wrote: Is this what you were looking for: x - scan(textConnection( 1372.23718 2.277450e+04 +74.48333 5.494448e+01 + 226.63590

[R] Binding result of a function to a data frame

2008-06-23 Thread Gundala Viswanath
. bind the output of the kurtosis function to mydata. Why my code below doesn't work? What's the solution for it? binded_mydata_withkurt - cbind(mydata, kurt=apply(mydata,1,kurtosis(mydata[,3:ncol(repo.dat)]),na.rm = TRUE)) - Gundala Viswanath Jakarta - Indonesia

[R] Measuring Goodness of a Matrix

2008-06-24 Thread Gundala Viswanath
, and B vs X) ? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Measuring Goodness of a Matrix

2008-06-24 Thread Gundala Viswanath
Thanks so much all. I will try out each of your suggestions. - Gundala Viswanath Jakarta - Indonesia On Wed, Jun 25, 2008 at 8:01 AM, Moshe Olshansky [EMAIL PROTECTED] wrote: What do you mean by A similar to X? Do you mean norm of the difference, similar eigenvalues/vectors, anything else

[R] Average of Two Matrices

2008-06-24 Thread Gundala Viswanath
Hi, I have two matrices x and y (same dimensions). How can I compute the average of x and y for each coordinate to form a new average matrix z ? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Unsqueezing Stacked Figures

2008-06-26 Thread Gundala Viswanath
, main=My Plot, split=c(1,1,1,2), more = TRUE ) gehist - hist(gexp.arr, col=blue, main = Density Plot, xlab = Exp Level, freq=FALSE ) lines(density(gexp.arr), col = red,lwd = 3, split=c(1,2,1,2)) dev.off() __END__ - Gundala

[R] Superimposing Multiple Vectors Plots in One Figure

2008-06-27 Thread Gundala Viswanath
(vect2,type=l,col=blue) plot(vect3,type=l,col=green) # final graph only showed this one. dev.off() __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Superimposing Multiple Vectors Plots in One Figure

2008-06-27 Thread Gundala Viswanath
Dear Petr, Thanks so much for your detailed guidance. I'll have a look at your suggestions. - Gundala Viswanath Jakarta - Indonesia On Fri, Jun 27, 2008 at 7:09 PM, Petr PIKAL [EMAIL PROTECTED] wrote: Hi you mix base and lattice graphics. [EMAIL PROTECTED] napsal dne 27.06.2008 08:25:55

[R] Plotting Bi-Gamma Distribution

2008-07-01 Thread Gundala Viswanath
=FALSE ) # Normal Curve lines(density(gexp.arr), col = red,lwd = 3) # Gamma Curve curve(dgamma(x,1.25,gexp.ymax),add=TRUE,col=green,lwd=3) __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https

[R] Method for checking automatically which distribtions fits a data

2008-07-06 Thread Gundala Viswanath
Hi, Suppose I have a vector of data. Is there a method in R to help us automatically suggest which distributions fits to that data (e.g. normal, gamma, multinomial etc) ? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list

[R] Plot Mixtures of Synthetically Generated Gamma Distributions

2008-07-06 Thread Gundala Viswanath
each component. How can I do that? I tried this but doesn't work: lines(density(x)) Please advise. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Howto Initialize Parameter of Gamma Mixture Densities for EM

2008-07-07 Thread Gundala Viswanath
on how it is done and why. Please advice. - Gundala Viswanath Jakarta-Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

[R] Finding Values that Occur Most Often in a Vector

2008-07-10 Thread Gundala Viswanath
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

[R] Meaning of Positive LogLikelihood

2008-07-11 Thread Gundala Viswanath
(dens(lmbd, thet,1,w),1,sum))) cat(Try, try, - LL, ll, \n) } __END__ - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] Howto view function's source code of an installed package

2008-07-16 Thread Gundala Viswanath
at the zip file, but somehow I can't seem to find the file on which I can find the source code. Please advice. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] How to compute loglikelihood of Lognormal distribution

2008-07-17 Thread Gundala Viswanath
Hi, I am trying to learn lognormal mixture models with EM. I was wondering how does one compute the log likelihood. The current implementation I have is as follows, which perform really bad in learning the mixture models. __BEGIN__ # compute probably density of lognormal. dens -

[R] Howto Restart A Function with Try-Error Catch

2008-07-21 Thread Gundala Viswanath
=val1, output2 = val2) a } out - try(suppressWarnings(myfunction(x)),silent=T) if (class(out) == try-error) { #this clause doesn't seem to redo out - myfunction(X) } else { ll - out$output1 } __END__ - Gundala

[R] Howto Draw Bimodal Gamma Curve with User Supplied Parameters

2008-07-29 Thread Gundala Viswanath
comp.2 alpha (shape) 2.855444 2.152056 beta (scale) 10.418785 39.296224 These params are predefined/precalculated by user. My question is how can I create a bimodal gamma curve - based on the two parameter set - on top of the histogram of data points above? - Gundala Viswanath Jakarta

[R] Identifying Points That Belongs to Components of Mixture Models

2008-07-31 Thread Gundala Viswanath
identify which members of x belong to component 1 and 2? - Gundala Viswanath Jakarta - Indonesia PS. The posterior probability and loglikelihood for each iteration given by EM can be found here: http://dpaste.com/68667/plain/ __ R-help@r-project.org

[R] Storing Matrices into Hash

2008-07-31 Thread Gundala Viswanath
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 __ R-help@r

Re: [R] Storing Matrices into Hash

2008-07-31 Thread Gundala Viswanath
. __END__ - Gundala Viswanath Jakarta - Indonesia On Fri, Aug 1, 2008 at 11:01 AM, Erik Iverson [EMAIL PROTECTED] wrote: I think a named list is probably the easiest way to start off, something like: all_mat - list(mat1 = mat1, mat2 = mat2) all_mat$mat2 Gundala Viswanath wrote: Hi

[R] Grouping Index of Matrix Based on Certain Condition

2008-07-31 Thread Gundala Viswanath
Is there a simple way to do it in R? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented

[R] Remove Even Number from A Vector

2008-07-31 Thread Gundala Viswanath
, . (keep odd number). - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

[R] Function to check the presence of an Item in an array

2008-08-01 Thread Gundala Viswanath
Hi all, Is there a way to do it? For example: x foo bar bar2 qux is there a function to return TRUE/FALSE given a test variable func(foo) TRUE func(GUNDALA) FALSE Is there such func in R? - Gundala Viswanath Jakarta - Indonesia __ R-help@r

Re: [R] Computing P-Value

2008-05-28 Thread Gundala Viswanath
-contained, reproducible code. -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] Separator argument in read.table

2008-05-28 Thread Gundala Viswanath
separator used for read.table function? I tried this: dat - read.table(geo2geneinfo_bymodel.txt, sep = |) print(dat) It doesn't seem to work. It flattens the table above into just two columns meaning only contain $V1 and $V2. sep= | also won't work. Please advice. -- Gundala Viswanath

[R] Levels error after printing

2008-05-28 Thread Gundala Viswanath
What's the meaning of the last line? Is it an error? How can I fix it? -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] Argument Passing Construct in R Script

2008-05-29 Thread Gundala Viswanath
Hi, How can I create a construct argument passing in R script. So that later I can call it like this: $ R --vanilla myscript.R ARGUMENT1 ARGUMENT2 -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] Creating/Concatenate Strings into another String

2008-05-29 Thread Gundala Viswanath
Is there a way to do it? For example I tried this: args-commandArgs() fname - args[6].-.args[9] # then I would like to create a file # using the above created name postscript(filename=fname) dev.off() But that concatenation doesn't seem to do it. -- Gundala Viswanath

[R] Multiple comment.char under read.table

2008-06-06 Thread Gundala Viswanath
= null, sep = \t); Please advice. -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

Re: [R] Multiple comment.char under read.table

2008-06-07 Thread Gundala Viswanath
, comment.char = c(!,^) , na.strings = null, sep = \t); Please advice. -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] Usefulness of scale function

2008-06-07 Thread Gundala Viswanath
, in general: 1. What is the purpose of 'scale' function? 2. When one should use it? -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] Default Argument Passing in Script

2008-06-08 Thread Gundala Viswanath
would be: my $param = $ARGV[0] || default_argument; I am wondering how can this be done in R. -- Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org

[R] Invalid Type of Char Argument When Sum() is Used

2009-03-13 Thread Gundala Viswanath
that it gives such error? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal

[R] Cumulative Plot with Given X-Axis

2009-03-18 Thread Gundala Viswanath
0.0141398 0.0142373 7 0.0101515 0.0102948 8 0.0308843 0.031294 9 0.0095504 0.00960626 10 0.00729676 0.0073713 - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https

[R] Simple Plot with Grid's Viewport

2009-03-18 Thread Gundala Viswanath
); } } dev.off() __END__ - Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] Howto Supress Extra Blank Page in gridBase

2009-03-19 Thread Gundala Viswanath
(grid) library(gridBase) opar - par(no.readonly=TRUE) par(opar) grid.newpage() pushViewport(viewport(width=0.5, height=0.5)) grid.rect(gp=gpar(col=grey, lty=dashed)) par(omi=gridOMI()) par(mfrow=c(2, 2), mfg=c(1, 1), mar=c(3, 3, 1, 0)) for (i in 1:4) { plot(1:10) } __ END__ - Gundala Viswanath

[R] Barplot With Selected X-Axis Region

2009-03-24 Thread Gundala Viswanath
information, hence I am aware that I dont' want: plot(hist(dat[dat =-500 dat =500])) - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Howto Disable Scientific Numeric in X-axis for Plotting

2009-04-02 Thread Gundala Viswanath
- Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

[R] How to force an point in x-axis to appear in plot

2009-04-02 Thread Gundala Viswanath
marks. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] Filling in Gapped Interval of a Data Frame As Series

2009-04-05 Thread Gundala Viswanath
16 6 44.5 17 7 5.00 Is there a way to do it in R? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

[R] Howto Plot With Transparent Background

2009-04-08 Thread Gundala Viswanath
Is there a way to do it in R? Especially generating plot in EPS/PDF format. By transparent I mean clear (not white) background. I want to attached it to dark PPT slides. - Gundala Viswanath __ R-help@r-project.org mailing list https://stat.ethz.ch

[R] Coloring X and Y axis

2009-04-10 Thread Gundala Viswanath
Dear all, Is there a way to do it? The following code: pdf(test.pdf) plot(1,1,col=red) dev.off() Only colors the plot into red, but not x and y axis (inclusive the tick marks). - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org

[R] How to control distance between rows of figures in multiple plots

2009-04-16 Thread Gundala Viswanath
Dear all, I have a plot with 2 x 2 figures matrix in it. pdf(~/Desktop/myplot.pdf,width=13,height=7) par(mfrow=c(2,2)) # follow by some code Now the distance between figures of row 1 and row 2 is too wide. How can I modify? - Gundala Viswanath Jakarta - Indonesia

[R] Coloring X, Y and Main Label

2009-04-17 Thread Gundala Viswanath
Dear all, I have no problem coloring the axis and plot, following these procedures: http://www.nabble.com/Coloring-X-and-Y-axis-tt22989739r0.html#a22989739 However the X,Y and Main Label stays in black. How can we change their colors? - Gundala Viswanath Jakarta - Indonesia

[R] How to extract integer in a data frame

2009-04-21 Thread Gundala Viswanath
frame where the entry in V1 has (x.000) as its decimal. yielding wanted_dat V1 V2 V3 1 0.000 2 554889 2 123.000 03209 What's the way to do it in R? - Gundala Viswanath Jakarta - Indonesia __ R-help

Re: [R] Problem with Grep Under Loop

2008-10-06 Thread Gundala Viswanath
Dear all, This is the sample of the source data (tab delimited) http://dpaste.com/82660/plain/ - Gundala Viswanath Jakarta - Indonesia On Mon, Oct 6, 2008 at 9:05 PM, Gustaf Rydevik [EMAIL PROTECTED] wrote: On Mon, Oct 6, 2008 at 1:37 PM, Gundala Viswanath [EMAIL PROTECTED] wrote: Dear all

[R] Problem with Grep Under Loop

2008-10-06 Thread Gundala Viswanath
-length row.names) [1] AB002296 [1] V1 V2 V3 V4 V5 V6 V7 0 rows (or 0-length row.names) . What's wrong with my way of using grep? Please advice. - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] Read.table fail to recognize (+/-) sign

2008-10-06 Thread Gundala Viswanath
. Is there a way I can enable read.table to recognize those signs? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

  1   2   >