Re: [R] baseline fitters

2007-02-20 Thread Tuszynski, Jaroslaw W.
@stat.math.ethz.ch Cc: Tuszynski, Jaroslaw W. Subject: baseline fitters I am pretty pleased with baselines I fit to chromatograms using the runquantile() function in caTools(v1.6) when its probs parameter is set to 0.2 and its k parameter to ~1/20th of n (e.g., k ~ 225 for n ~ 4500, where n is time series length

Re: [R] How can you buy R?

2006-05-19 Thread Tuszynski, Jaroslaw W.
On 5/19/06, J Dougherty [EMAIL PROTECTED] wrote: While there is no charge for R, it IS properly licensed properly licensed under the GPL. At one company I was working for, I had to run all the licenses of all the software I had on my machine, through the legal department. When they read GNU

Re: [R] Package docs for CRAN

2006-05-01 Thread Tuszynski, Jaroslaw W.
See Function promptPackage() and http://cran.r-project.org/doc/manuals/R-exts.html#Rd-format section 2.1.4 fpr writing Rd files for packages. I just did it first time for my package caMassClass, so you can see the results in its pdf file. Jarek Tuszynski -Original Message- From: [EMAIL

Re: [R] R icon image file

2006-03-20 Thread Tuszynski, Jaroslaw W.
http://cran.r-project.org/Rlogo.jpg In the future all you have to do (on PC) is to right click on image you want and press properties to get the exact link. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erin Hodgess Sent: Wednesday,

Re: [R] How to compare areas under ROC curves calculated with ROC R package

2006-03-20 Thread Tuszynski, Jaroslaw W.
I might be missing something but I thought that AUC was a measure for comparing ROC curves, so there is nothing else needed to compare them. The larger AUC is the higher correlation of 2 variables compared. No other measures or calculations are needed. Jarek Tuszynski -Original Message-

Re: [R] need help in tune.nnet

2006-03-14 Thread Tuszynski, Jaroslaw W.
You use tune function to find optimal parameters needed for particular classification algorithm. I had more experience with tune.svm but, I would try first to put parameters covering the whole possible range of each variable (in which algorithm do not crash), for example c(4^-2, 4^-1, 4^0, 4^1,

Re: [R] C-Code in R (running Windows)

2006-03-01 Thread Tuszynski, Jaroslaw W.
The simplest way to add C (C++) code in R, that I know is by creating a package ( even if you are not planning on distributing it). See 'Writing R Extensions' manual (http://cran.r-project.org/manuals.html) for details. Download source codes of packages for more examples, many of them will have .c

Re: [R] need palette of topographic colors similar to topo.colors ()

2006-01-09 Thread Tuszynski, Jaroslaw W.
I will second Roger's suggestion, colorRampPalette is a great function for creating your own palettes. For example, Matlab's jet palette (also available in fields package under peculiar name 'tim.colors') can be defined by: jet.colors = colorRampPalette(c(#7F, blue, #007FFF, cyan, #7FFF7F,

Re: [R] Looking for packages to do Feature Selection and Classifi cation

2006-01-09 Thread Tuszynski, Jaroslaw W.
Hi, You should also check my msc.features.select from caMassClass package. It has feature selection algorithm that I found useful in case of mass-spectra data. It performs individual feature selection and/or removes highly correlated neighbor features. Jarek -Original Message- From:

[R] Wilcoxon Mann-Whitney Rank Sum Test

2005-12-16 Thread Tuszynski, Jaroslaw W.
Does anybody know what is relation between 'T' value calculated by 'wilcox_test' function (coin package) and more common 'W' value? Jarek Tuszynski library(coin) ### Tritiated Water Diffusion Across Human Chorioamnion ### Hollander Wolfe (1999), Table 4.1, page 110 water_transfer -

[R] Name conflict between Epi and ROC packages

2005-12-15 Thread Tuszynski, Jaroslaw W.
The name conflicts in Epi and ROC packages (2 'ROC' functions are the problem) cause the following code to work once, but not twice: library(MASS); data(cats); x = cats[,2] y = ifelse(cats[,1]=='F',0,1) library(Epi); ROC(x,y,grid=0)$AUC library(ROC); AUC(rocdemo.sca(y, x, dxrule.sca))

Re: [R] Finding all possible partitions of N units into k classe

2005-12-08 Thread Tuszynski, Jaroslaw W.
See Also http://finzi.psych.upenn.edu/R/library/caTools/html/combs.html Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, December 08, 2005 11:19 AM To: Ales Ziberna Cc: R-help Subject: Re: [R] Finding all possible partitions of N

Re: [R] sign and sign rank tests

2005-12-02 Thread Tuszynski, Jaroslaw W.
See Wilcox.test and Wilcox_test functions. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Sorkin Sent: Friday, December 02, 2005 7:13 AM To: r-help@stat.math.ethz.ch Subject: [R] sign and sign rank tests R 2.1.1 on Windows 2K I

Re: [R] cant get colAUC to plot

2005-12-01 Thread Tuszynski, Jaroslaw W.
It is a bug, I will have to fix. I assumed that data will have column names I can use for legend. So temporary fix is to provide column names: library(caTools) a-matrix(rnorm(100), 100,1) b-rbinom(100,1,0.7) colnames(a) = test; colAUC(a,b,plotROC=TRUE) Thanks for reporting it. Jarek Tuszynski

Re: [R] finding peaks in a simple dataset with R

2005-11-28 Thread Tuszynski, Jaroslaw W.
of those solutions works for you. Good Luck. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 23, 2005 5:47 PM To: r-help@stat.math.ethz.ch Cc: Tuszynski, Jaroslaw W. Subject: Re: [R] finding peaks in a simple dataset with R

Re: [R] obtaining a ROC curve

2005-11-28 Thread Tuszynski, Jaroslaw W.
See, my old post at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/61879.html to see a list of ROC related packages and functions. One of them should work well for your application. All of them take data in the form: - x - real number value returned by the classifier - y - true labels /

Re: [R] PNG-import into R

2005-11-21 Thread Tuszynski, Jaroslaw W.
I was looking once for all supported image formats, here is what I found: Format | read file to matrix | write matrix to file | write plot to file ---|-|--|--- PNG| | | png, bitmap, GDD JPEG

[R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
Hi, While installing precompiled packages I often get warnings like the one in the subject. I usually ignore them, but I still do not understand why windows packages are build with unreleased versions of R. Is there some way to get packages build under R-2.2.0? What are potential problems that

Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 16, 2005 11:27 AM To: Tuszynski, Jaroslaw W. Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Warning message: package '...' was built under R version 2.3.0 Tuszynski, Jaroslaw W. wrote: Hi, While installing precompiled packages I often get

Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
downloaded from PA1 does not give me any warnings or errors. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 16, 2005 1:04 PM To: Tuszynski, Jaroslaw W. Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Warning message: package

Re: [R] Warning message: package '...' was built under R version 2.3.0

2005-11-16 Thread Tuszynski, Jaroslaw W.
Yes. The Statlib mirror (which I suppose is what you call PA2) appears to be badly messed up. -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark

Re: [R] Search within a file

2005-11-04 Thread Tuszynski, Jaroslaw W.
Thanks for a great suggestions. I guess the code you suggested would look something like this: fregexpr = function(pattern, filename) { # same as gregexpr but operating on files not strings # Only single string 'pattern's allowed buf.size=1024 n = file.info(filename)$size

Re: [R] Real FFT

2005-11-04 Thread Tuszynski, Jaroslaw W.
How about 'fft' function. It is a little higher level than Fortran function you mention, since array can be any length and you do not need to pack complex numbers into a vector of floats. Jarek Tuszynski -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[R] Search within a file

2005-11-03 Thread Tuszynski, Jaroslaw W.
Hi, I am looking for a way to search a file for position of some expression, from within R. My current code: sha1Pos = gregexpr(sha1, readChar(filename, file.info(filename)$size))[[1]] Works fine for small files, but text files I will be working with might get up to Gb range, so I was trying

[R] Sum of logical vector

2005-10-31 Thread Tuszynski, Jaroslaw W.
Hi, Recently I was told by users of some of the function I wrote that they experience crashes in places where logical vector was passed to sum function. However on my computer those functions work just fine. After closer look at documentation of function 'sum', I realized that it is defined only

Re: [R] Still a bug with NA in sd() or var()?

2005-10-31 Thread Tuszynski, Jaroslaw W.
Try: sd (x,na.rm=TRUE) [1] 1.707825 Jarek \ Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,| (703) 676-4192 \ [EMAIL PROTECTED]

Re: [R] Efficient ways of finding functions and Breslow-Day test for homogeneity of the odds ratio

2005-10-18 Thread Tuszynski, Jaroslaw W.
Try Breslow OR Breslowday filetype:R -robol search in Google. Jarek \ Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,| (703) 676-4192 \

Re: [R] Animated lissajous

2005-10-17 Thread Tuszynski, Jaroslaw W.
Pretty neat. Jarek \ Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,| (703) 676-4192 \ [EMAIL PROTECTED] ` \

[R] Questions about readBin function (Was: dec2bin?)

2005-10-12 Thread Tuszynski, Jaroslaw W.
Hi, The latest version of R had some changes to functions readbin() and writeBin() [which] now support raw vectors as well as filenames and connections.. As a result I am working on retiring raw2bin and bin2raw functions from caTools package which do exactly the same. Thanks to Prof. Ripley for

Re: [R] R data import

2005-10-12 Thread Tuszynski, Jaroslaw W.
A few suggestions: - read.fwf function sounds like what you need, but I have never used it so I am not sure - use readLines and manually extract needed positions and convert them to numbers Jarek \ Jarek Tuszynski, PhD.

Re: [R] matrix operation

2005-10-10 Thread Tuszynski, Jaroslaw W.
There a re a few ways to do it without loop. Here is one: dat = matrix(runif(100), 50,2) dat[,1] = dat[,1] = dat[,2] Jarek \ Jarek Tuszynski, PhD. o / \ Science Applications International Corporation

Re: [R] The R Graph Gallery {was boxplot statistics}

2005-10-07 Thread Tuszynski, Jaroslaw W.
I agree with Martin R Graph Gallery has a lot of neat stuff. I also think there should be a on CRAN website a list of R websites. And in a perfect world one of the search engines scope would get extended to search them all. Jarek \

Re: [R] Applying a function to each element of an array

2005-10-07 Thread Tuszynski, Jaroslaw W.
I suspect that loop would be the fastest since it would have the least memory overhead. You do not want to have too many internal copies of 7000x7000 matrices. Jarek \ Jarek Tuszynski, PhD. o / \ Science

Re: [R] playing with R: make a animated GIF file...

2005-10-06 Thread Tuszynski, Jaroslaw W.
See write.gif function in caTools. Jarek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of klebyn Sent: Wednesday, October 05, 2005 8:05 PM To: r-help@stat.math.ethz.ch Subject: [R] playing with R: make a animated GIF file... Hello all I am playing

Re: [R] Animation of Mandelbrot Set

2005-10-06 Thread Tuszynski, Jaroslaw W.
\__,| (703) 676-4192 \ [EMAIL PROTECTED] ` \ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 06, 2005 8:19 AM To: roger bos; Tuszynski, Jaroslaw W. Cc: ([EMAIL PROTECTED]) Subject: Re

[R] Animation of Mandelbrot Set

2005-10-04 Thread Tuszynski, Jaroslaw W.
Hi, I was playing with Mandelbrot sets and come up with the following code, I thought I would share: library(fields) # for tim.colors library(caTools) # for write.gif m = 400 # grid size C = complex( real=rep(seq(-1.8,0.6, length.out=m), each=m ), imag=rep(seq(-1.2,1.2,

Re: [R] dec2bin?

2005-10-03 Thread Tuszynski, Jaroslaw W.
It is unclear what you are trying to do, but check bin2raw in caTools package: print(x - (1:5)*pi) [1] 3.141593 6.283185 9.424778 12.566371 [5] 15.707963 print(y - bin2raw(x)) [1] 18 2d 44 54 fb 21 09 40 18 2d 44 54 fb 21 19 [16] 40 d2 21 33 7f 7c d9 22 40 18 2d 44 54 fb 21

Re: [R] dec2bin?

2005-10-03 Thread Tuszynski, Jaroslaw W.
\ [EMAIL PROTECTED] ` \ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 03, 2005 11:49 AM To: Tuszynski, Jaroslaw W. Cc: Haiyong Xu; Help R Subject: Re: [R] dec2bin? On Mon, 3 Oct 2005, Tuszynski

Re: [R] Library error when using R CMD check

2005-10-03 Thread Tuszynski, Jaroslaw W.
Maybe you forgot to list the name of dependent package in 'Depends' section of 'DESCRIPTION' file. I think that would have effect you describe. See http://cran.r-project.org/doc/manuals/R-exts.html#The-DESCRIPTION-file for details. Jarek -Original Message- From: [EMAIL PROTECTED]

Re: [R] .C help

2005-09-30 Thread Tuszynski, Jaroslaw W.
See http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs/ and R Installation and Administration manual for details that will have to be followed very precisely. My own 2 cents below should be taken as fuzzy recollections, compared to detailed directions in 2 sources above. I do not know

Re: [R] Fast AUC computation

2005-09-29 Thread Tuszynski, Jaroslaw W.
See colAUC in caTools (there is a problem with 1.3 version, 1.4 is on the way). See examples for other functions calculating AUC. An alternative approach is: x1 = x[y==1]; n1 = length(x1); x2 = x[y==0]; n2 = length(x2); r = rank(c(x1,x2)) auc =

Re: [R] how to keep very small or large number?

2005-09-22 Thread Tuszynski, Jaroslaw W.
R can hold very small numbers. It is the round-off error during addition (and other basic operations) that causes the problem. For example: x=1e-300 x [1] 1e-300 (x+1)-1 [1] 0 If you need a code that can be immune to round-off problems - you need to write it yourself (please correct me if I

[R] Survey of ROC AUC / wilcoxon test functions

2005-09-22 Thread Tuszynski, Jaroslaw W.
Hi, I was lately debugging parts of my 'colAUC' function in caTools package, and in a process looked into other packages for calculating Areas Under ROC Curves (AUC). To my surprise I found at least 6 other functions: * wilcox.test * AUC from ROC package, * performance

Re: [R] Survey of ROC AUC / wilcoxon test functions

2005-09-22 Thread Tuszynski, Jaroslaw W.
ROC package can be found in BioConductor repository. Jarek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 22, 2005 3:28 PM To: Tuszynski, Jaroslaw W. Cc: ([EMAIL PROTECTED]); [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Survey of ROC

[R] Splitting the string at the last sub-string

2005-09-15 Thread Tuszynski, Jaroslaw W.
Hi, I need to split a string into 2 strings, with the split point defined by the last occurrence of some substring. I come up with some convoluted code to do so: str = Chance favors the prepared mind sub = e y = unlist(strsplit(str,sub)) z = cbind(paste(y[-length(y)], sub, sep=, collapse = ),

Re: [R] Splitting the string at the last sub-string

2005-09-15 Thread Tuszynski, Jaroslaw W.
Thanks for suggestions. I suspect the regexpr version will be better than my version, since I use it to find an string towards the end of a large (up to ~30Mb) test/XML file. Thanks again. Jarek \ Jarek Tuszynski, PhD.

Re: [R] VB and R

2005-09-13 Thread Tuszynski, Jaroslaw W.
I belive R, which is platform independent, does not work with any platform specific software or languages, like Visual Basic. Can you write your code by passing information through input/output files (CSV HML might be good formats)? Jarek Tuszynski SAIC -Original Message- From: [EMAIL

Re: [R] how to use the function from another package

2005-08-09 Thread Tuszynski, Jaroslaw W.
See Writing R Extensions / Creating R package / Description file / depends field (section 1.1.1). Jarek \=== Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,| (703) 676-4192

Re: [R] how to use the function from another package

2005-08-09 Thread Tuszynski, Jaroslaw W.
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 09, 2005 2:57 PM To: Tuszynski, Jaroslaw W. Subject: Re: [R] how to use the function from another package Thanks very much for your help. Do I still have to write library( ) to load the library in my code after I

[R] FW: color palette

2005-08-04 Thread Tuszynski, Jaroslaw W.
Try: n = 100; x = matrix(seq(-10, 30, length.out=500), ncol=1) col = colorRampPalette( c(green, white, red), space=rgb)(n) breaks = c(seq(-10, 0, length.out=n/2)-0.5, 0, seq(0, 30, length.out=n/2)+0.5) image(x, col=col, breaks=breaks) See also today's discussion on R-Help about

Re: [R] can we manage memory usage to increase speed?

2005-08-02 Thread Tuszynski, Jaroslaw W.
If you have a code that takes 2 weeks to run, than it might be a case of inefficient algorithm design. I was able to go from overnight runs (SELDI data analysis) to 20 minute runs by identifying single inefficient function that took most of the time, and writing it in C. Jarek

Re: [R] question on graphs and finding area under a curve

2005-08-02 Thread Tuszynski, Jaroslaw W.
How about: trapz = function(x, y) { # computes the integral of y with respect to x using trapezoidal integration. idx = 2:length(x) return (as.double( (x[idx] - x[idx-1]) %*% (y[idx] + y[idx-1])) / 2) } Jarek \=== Jarek Tuszynski,

Re: [R] How to hiding code for a package

2005-08-01 Thread Tuszynski, Jaroslaw W.
I always thought that ability to see and study the code of every package, was a great thing about R and other open source environments. So I hope there are no good ways of hiding the code of packages. Jarek \=== Jarek Tuszynski, PhD.

Re: [R] New functions supporting GIF file format in R

2005-08-01 Thread Tuszynski, Jaroslaw W.
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maechler Sent: Tuesday, July 19, 2005 2:53 AM To: Tuszynski, Jaroslaw W. Cc: ([EMAIL PROTECTED]) Subject: Re: [R] New functions supporting GIF file format in R JarekT == Tuszynski, Jaroslaw W [EMAIL PROTECTED] on Mon, 18 Jul

[R] New functions supporting GIF file format in R

2005-07-18 Thread Tuszynski, Jaroslaw W.
Hi, A minor announcement. I just added two functions for reading and writing GIF files to my caTools package. Input and output is in the form of standard R matrices or arrays, and standard R color-maps (palettes). The functions can read and write both regular GIF images, as well as,

[R] Passing character strings from C code to R

2005-07-15 Thread Tuszynski, Jaroslaw W.
Hi, I have a C code which produces array of integers and potentially a string, and I have problems passing the string out. Here is the relevant part of the code: 1 PROTECT(Ret = allocVector(INTSXP, n)); 2 ret = (int*) INTEGER(Ret); /* get pointer to R's Ret */ 3 for(i=0; in; i++)

Re: [R] Is there a working XML parser for the windows R Version 2 .0.1

2005-07-13 Thread Tuszynski, Jaroslaw W.
I do not know if current XML package suppose to work for windows R Version 2.0.1; however, current version of XML works fine for current version of R (2.1.1). Also, version of XML available when R Version 2.0.1 was current, worked just fine as well. So the answer might be to update your R version.

Re: [R] about image() function in R and colors

2005-07-07 Thread Tuszynski, Jaroslaw W.
I do not know the solution to your problem, but I had the similar problems with image() function and most of derived functions. It seems that 'image' function was really not meant for displaying image data, instead it was designed to display matrices in the image format. Matlab had the same

[R] Is.integer and testing for integers

2005-06-30 Thread Tuszynski, Jaroslaw W.
Hi, I was trying to figure out if there is a function in R that tests if R object contains only integers. I though is.integer would be it, but this function only checks whether its argument is of integer type or not. As a result x = (1:5)^2 is.integer(x) Returns false. Of course

Re: [R] x*x*x*... vs x^n

2005-06-29 Thread Tuszynski, Jaroslaw W.
I tried your code and got different results: system.time(ignore - f1(a)) [1] 0.83 0.09 1.08 NA NA system.time(ignore - f2(a)) [1] 0.38 0.01 0.41 NA NA system.time(ignore - f3(a)) [1] 0.32 0.04 0.43 NA NA So I tried it again but with a

[R] all connections are in use error during lazyload stage of packa ge installation

2005-06-29 Thread Tuszynski, Jaroslaw W.
Hi, I suddenly started getting strange errors while working on my caTools package: RCMD install C:/programs/R/rw2011/src/library/caTools .. preparing package caTools for lazy loading Error in file(file, r, encoding = encoding) : all connections are

Re: [R] all connections are in use error during lazyload stage of packa ge installation

2005-06-29 Thread Tuszynski, Jaroslaw W.
PROTECTED] `\ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 10:07 AM To: Tuszynski, Jaroslaw W. Cc: r help Subject: Re: [R] all connections are in use error during lazyload stage of packa ge installation On 6/29

Re: [R] Numerical accuracy

2005-06-27 Thread Tuszynski, Jaroslaw W.
I do not know about details of numerical accuracy of R, it is probable related to numerical accuracy of C compiler that was used to compile it (gcc ?). However I would like to mention that I run into some problems with accuracy of sum and cumsum functions. See: x = c(1, 1e20, 1e40, -1e40,

Re: [R] r programming help III

2005-06-24 Thread Tuszynski, Jaroslaw W.
I am not sure if you can make this code shorter through R specific programming, but You can through simple programming technique of using functions: pFunc = function (S, d, N, p01, p11) { c1-N+1/2-abs(2*S-N-1/2+d); c-1:c1; a-ceiling((c-1+d)/2); b-ceiling((c-d)/2);

Re: [R] Stop Warnings for Invalid Factor Level, NAs generated?

2005-06-23 Thread Tuszynski, Jaroslaw W.
Check suppressWarnings function. Jarek \=== Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,| (703) 676-4192 \ [EMAIL PROTECTED]

[R] [R-pkgs] Release of new version of caMassClass package and new package caT ools

2005-06-18 Thread Tuszynski, Jaroslaw W.
Hi, A new version of caMassClass package was released today. The package contain pipeline for processing and classification of protein mass spectra data. The main change is off-spinning from the library collection of generic functions into a new package caTools. This package, which might be

Re: [R] Reading Excel files...Error

2005-06-15 Thread Tuszynski, Jaroslaw W.
If you need work-around, than you can always save excel file in csv format and than read that. See 'read.csv' or 'read.csv2'. Jarek \=== Jarek Tuszynski, PhD. o / \ Science Applications International

[R] FYI: Problems while loading package class (VR)

2005-05-31 Thread Tuszynski, Jaroslaw W.
Hi, Today, I performed automatic updates of packages and somehow lost class package. I loaded a library that depended on it and got: Error: package 'class' could not be loaded In addition: Warning message: there is no package called 'class' in: library(pkg, character.only = TRUE,

RE: [R] FYI: Problems while loading package class (VR)

2005-05-31 Thread Tuszynski, Jaroslaw W.
AM To: Tuszynski, Jaroslaw W. Cc: ([EMAIL PROTECTED]); '[EMAIL PROTECTED]' Subject: Re: [R] FYI: Problems while loading package class (VR) Tuszynski, Jaroslaw W. wrote: Hi, Today, I performed automatic updates of packages and somehow lost class package. I loaded a library that depended

RE: [R] xmlAttrs and problems with reading node attributes of XML file (b ug?)

2005-05-31 Thread Tuszynski, Jaroslaw W.
as attribute but its name got truncated from xsi:schemaLocation to schemaLocation. Jarek -Original Message- From: Duncan Temple Lang [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 31, 2005 11:38 AM To: Tuszynski, Jaroslaw W. Cc: ([EMAIL PROTECTED]); '[EMAIL PROTECTED]' Subject: Re: [R

[R] xmlAttrs and problems with reading node attributes of XML file (b ug?)

2005-05-27 Thread Tuszynski, Jaroslaw W.
Hi, Consider the following code: require(XML) xmlFile = paste( ?xml version=\1.0\ encoding=\ISO-8859-1\?\n, mzXML xmlns=\a\ xmlns:xsi=\b\ xsi:schemaLocation=\c\\n, parentFile a=\a\ b=\b\ /\n, /mzXML\n)

RE: [R] Useful tip: Use Google to find R scripts

2005-05-26 Thread Tuszynski, Jaroslaw W.
Great tip. Thanks. One problem: a lot of hits are in REBOL language (whatever it is) that also uses R extension. Jarek \=== Jarek Tuszynski, PhD. o / \ Science Applications International Corporation \__,|

[R] Reading text files and readLine

2005-05-26 Thread Tuszynski, Jaroslaw W.
Hi, I am trying to write a function to read in a whole text file as a single string ( so I can calculate its sha1 hash function using package digest). I need a single string containing the whole file, and so far I was using paste(readLines(fileName), collapse = ). Unfortunately this function

RE: [R] colors and palettes and things...

2005-05-23 Thread Tuszynski, Jaroslaw W.
Colors predefined in R follow closely colors predefined in in HTML language. See: http://users.rcn.com/giant.interport/COLOR/1ColorSpecifier.html http://www.brobstsystems.com/colors1.htm http://www.geocities.com/html4kids/colors.htm And probably countless other websites defining them. Jarek

[R] Big-endian / Little-endian byte swap

2005-05-20 Thread Tuszynski, Jaroslaw W.
Hi, Is there a way to perform Big-endian / Little-endian byte swap in R? An ugly way is by using readBin/writeBin: ByteSwap = function(X, size) { writeBin(X, tmp.dat) readBin(tmp.dat, typeof(X), n = length(x), size=size, endian=swap) } x =

RE: [R] R matrix sorting question

2005-05-19 Thread Tuszynski, Jaroslaw W.
Try: A=matrix(c(1,3,4,5,7, -0.2, 0.8, 0.3, 0.2, 0.9 ),5,2) A [,1] [,2] [1,]1 -0.2 [2,]3 0.8 [3,]4 0.3 [4,]5 0.2 [5,]7 0.9 A[order(A[,2]), ] [,1] [,2] [1,]1 -0.2 [2,]5 0.2 [3,]4 0.3 [4,]3 0.8 [5,]7 0.9 Jarek

RE: [R] Survey of moving window statistical functions - still l ooking for fast mad function

2005-05-17 Thread Tuszynski, Jaroslaw W.
On 9 Oct 2004, Brian D. Ripley wrote: On Fri, 8 Oct 2004, Tuszynski, Jaroslaw W. wrote: Finally a question: I still need to get moving windows mad function faster my runmad function is not that much faster than apply/embed combo, and that I used before, and this is where my code

[R] Latex can not find Rd.sty

2005-05-06 Thread Tuszynski, Jaroslaw W.
Hi, Lately my Latex engine used for checking packages stop working, and I can not figure out how to fix it. When creating my package (caMassClass) I get the * checking caMassClass-manual.tex ... ERROR LaTeX errors when creating DVI version. This typically indicates Rd problems.

[R] Error list and debugging R code

2005-04-27 Thread Tuszynski, Jaroslaw W.
Hi, I am trying to debug my code and looking for any tool to help me out with it. My main problem is with the error messages I can not figure out where they come from (what function produced them) and what do they mean. Is there such a think as list of error messages produced by R and standard R

FW: [R] Advice for calling a C function

2005-04-26 Thread Tuszynski, Jaroslaw W.
I think it is a problem with matrices in R and C being stored in different row/column order void gowsim ( double *mat, int *OBJ, int *MATDESC) { double x [*MATDESC][*OBJ]; int i, j, nrow, ncol; nrow = *OBJ; ncol = *MATDESC; /* Rebuild Matrix */ for (j=0; j ncol; j++)

[R] Casting in R

2005-03-25 Thread Tuszynski, Jaroslaw W.
Hi, I am looking for functions that would allow me to access raw binary data of R vectors. One way would be to use: x = (1:10)*pi writeBin(x, temp.bin) r = readBin(temp.bin, raw, n=length(x)*8) Other to write my own C code. Is there any other simpler way? I this message

RE: [R] Casting in R

2005-03-25 Thread Tuszynski, Jaroslaw W.
25, 2005 11:28 AM To: 'Tuszynski, Jaroslaw W.'; r-help@stat.math.ethz.ch Subject: RE: [R] Casting in R Have you looked at the XML package on CRAN? -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning

[R] Unexpected error subset assignment (bug?)

2005-03-24 Thread Tuszynski, Jaroslaw W.
Hi, I run into following problem. It seems to me that operation in the 3rd line should be valid. b = matrix(as.raw(0), 8,8) q = as.raw(1:8) b[1,] = q Error: incompatible types in subset assignment length(b[1,]) [1] 8 typeof(b[1,]) [1] raw length(q) [1] 8 typeof(q) [1] raw Is this a bug

[R] Looking for function for Double to raw to double conversions

2005-03-23 Thread Tuszynski, Jaroslaw W.
Hello, I am trying to implement function for reading/writing some XML file format. One feature of that XML format is that a lot of binary data is stored in Base64 format, and since R's XML package does not seem to support it, I just wrote my own converter from raw format to Base64, and back.

[R] Problem with R CMD Rd2dvi: Rd.sty not found

2005-02-10 Thread Tuszynski, Jaroslaw W.
Hi, I run into a problem with R CMD Rd2dvi command: it gives me File `Rd.sty' not found error (See the output message on the bottom). I get the same error when running RCMD check. My system is: Windows 2000, R version 2.0.1, MiKTeX version 2.4. I do have a Rd.sty file in R_HOME/share/texm

[R] Problem with as.array (bug?)

2005-01-03 Thread Tuszynski, Jaroslaw W.
Hi, I run into the following problem: data(iris) as.array(iris[,-5]) Error in dimnames-.data.frame(`*tmp*`, value = list(c(Sepal.Length, : invalid dimnames given for data frame as.array(as.matrix(iris[,-5])) When trying to convert numeric data frame to an array. Conversion to matrix works

[R] Unexpected results from sort function when partial and index are used

2004-11-03 Thread Tuszynski, Jaroslaw W.
Hi, Consider the following example: sort(10:1, partial=3) ## 1 2 3 7 6 5 4 8 9 10 sort(10:1, index=T) ## $x: 1 2 3 4 5 6 7 8 9 10 ## $ix: 10 9 8 7 6 5 4 3 2 1 sort(10:1, partial=3, index=T) ## 1 2 3 7 6 5 4 8 9 10 The first 2 calls gave expected returns;

[R] Survey of moving window statistical functions - still looking f or fast mad function

2004-10-08 Thread Tuszynski, Jaroslaw W.
Hi, Lately I run into a problem that my code R code is spending hours performing simple moving window statistical operations. As a result I did searched archives for alternative (faster) ways of performing: mean, max, median and mad operation over moving window (size 81) on a vector with about