[R] gsub warning message

2007-08-31 Thread Talbot Katz
Hi. I am using R 2.5.1 on a Windows XP machine. Here is an example of a piece of code I was running in older versions of R on the same machine. I am looking for underscores and replacing them with periods. This result is from R 2.4.1: gsub ( \\_+,\.,AAA_I) [1] AAA.I Here is what I get in

Re: [R] gsub warning message

2007-08-31 Thread Talbot Katz
explaining this. -- TMK -- 212-460-5430home 917-656-5351cell From: Uwe Ligges [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] gsub warning message Date: Fri, 31 Aug 2007 18:04:39 +0200 Talbot Katz wrote: Hi. I am using R 2.5.1

Re: [R] gsub warning message

2007-08-31 Thread Talbot Katz
in a search but the same in a replacement. I hope I have that straight now. Thanks much! -- TMK -- 212-460-5430home 917-656-5351cell From: Greg Snow [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED],[EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: RE: [R] gsub warning

[R] Rdonlp2 control parameter question

2007-08-22 Thread Talbot Katz
Hi. I have been trying to work with the Rdonlp2 package. There is a control parameter called epsx that has the following description: epsx(1e-5) - successful temination is indicated if the Kuhn-Tucker criteria are satisfied within the value I have tried to use the donlp2.control() function

[R] Matrix Multiplication, Floating-Point, etc.

2007-07-30 Thread Talbot Katz
Hi. I recently tried the following in R 2.5.1 on Windows XP: ev2-c(0.8,-0.6) ev1-c(0.6,0.8) ev1%*%ev2 [,1] [1,] -2.664427e-17 sum(ev1*ev2) [1] 0 (I got the same result with R 2.4.1 on a different Windows XP machine.) I expect this issue is very familiar and probably has been

Re: [R] Matrix Multiplication, Floating-Point, etc.

2007-07-30 Thread Talbot Katz
(as.numeric(xf1%*%xf2))==(sum(xf1*xf2)) [1] TRUE Perhaps the moral of the story is that one should exercise caution and keep track of significant digits. -- TMK -- 212-460-5430home 917-656-5351cell From: Charles C. Berry [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help

[R] sub-function default arguments

2007-07-12 Thread Talbot Katz
Hi. I have defined a function, f1, that calls another function, f2. Inside f1 an intermediate variable called nm1 is created; it is a matrix. f2 takes a matrix argument, and I defined f2 (schematically) as follows: f2-function(nmArg1=nm1,...){nC-ncol(nmArg1); ... } so that it expects nm1 as

[R] factanal frustration!

2007-07-09 Thread Talbot Katz
Hi. It seems that nearly every time I try to use factanal I get the following response: faa2db1-factanal(mretdb1,factors=2,method=mle,control=list(nstart=25)) Error in factanal(mretdb1, factors = 2, method = mle, control = list(nstart = 25)) : unable to optimize from these starting

[R] Restoring .Random.seed

2007-05-31 Thread Talbot Katz
Hi. Suppose I have a function which does some random number generation within. The random number generation inside the function changes the value of .Random.seed in the calling environment. If I want to restore the pre-function call .Random.seed, I can do: save.seed-.Random.seed

Re: [R] Restoring .Random.seed

2007-05-31 Thread Talbot Katz
the setRNG package, which has a specific methodology for saving the random number generator state. -- TMK -- 212-460-5430home 917-656-5351cell From: Prof Brian Ripley [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] Restoring .Random.seed Date

[R] Testing for existence inside a function

2007-05-15 Thread Talbot Katz
Hi. I'm having trouble testing for existence of an object inside a function. Suppose I have a function: f-function(x){ ... } and I call it with argument y: f(y) I'd like to check inside the function whether argument y exists. Is this possible, or do I have to either check outside the

Re: [R] Testing for existence inside a function [Broadcast]

2007-05-15 Thread Talbot Katz
a bad programming paradigm. But even an explanation if that's the case would be appreciated. -- TMK -- 212-460-5430home 917-656-5351cell From: Liaw, Andy [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED],r-help@stat.math.ethz.ch Subject: RE: [R] Testing for existence inside a function

Re: [R] Testing for existence inside a function

2007-05-15 Thread Talbot Katz
with this. Thanks again! -- TMK -- 212-460-5430home 917-656-5351cell From: Liaw, Andy [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED],r-help@stat.math.ethz.ch Subject: RE: [R] Testing for existence inside a function Date: Tue, 15 May 2007 11:41:17 -0400 Just need a bit more work

[R] R Wiki down?

2007-05-03 Thread Talbot Katz
Hi. I can't access the site http://wiki.r-project.org/. I didn't find any notice about this on http://www.r-project.org/. Does anyone have any more information about the R Wiki status? Thanks! -- TMK -- 212-460-5430home 917-656-5351cell

[R] NYC Area R / S / S-Plus Users Group Forming, Thursday, April 26th

2007-04-12 Thread Talbot Katz
join, CONTACT: Talbot Katz, [EMAIL PROTECTED], 646.461.7840 If you don't already use R, you could (should!) start today – download R for free from the official R Project website (http://www.r-project.org/). The R Project site contains a wealth of resources for users, including FAQ pages, a user Wiki

[R] Outlier detection with the dprep library

2007-03-28 Thread Talbot Katz
Hi. The dprep library has at least three different methods for outlier detection: baysout, mahaout, robout. I wanted to test them on a very simple data set: vrmat-cbind((1:22),c(8,14,14,17,21,20,27,23,25,33,31,32,30,36,37,40,42,44,52,61,81,265)) As you can see by eyeballing this, the last

[R] lpSolve space problem in R 2.4.1 on Windows XP

2007-03-09 Thread Talbot Katz
Hi. I am trying to use the linear optimizer from package lpSolve in R 2.4.1 on Windows XP (Version 5.1). The problem I am trying to solve has 2843 variables (2841 integer, 2 continuous) and 8524 constraints, and I have 2 Gb of memory. After I load the input data into R, I have at most 1.5 Gb

Re: [R] lpSolve space problem in R 2.4.1 on Windows XP

2007-03-09 Thread Talbot Katz
-5430home 917-656-5351cell From: Uwe Ligges [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] lpSolve space problem in R 2.4.1 on Windows XP Date: Fri, 09 Mar 2007 17:51:30 +0100 If R is closed that way (i.e. crashes), it is a bug

[R] Linear programming with sparse matrix input format?

2007-03-05 Thread Talbot Katz
Hi. I am aware of three different R packages for linear programming: glpk, linprog, lpSolve. From what I can tell, if there are N variables and M constraints, all these solvers require the full NxM constraint matrix. Some linear solvers I know of (not in R) have a sparse matrix input format.

[R] Preserving order in an intersection

2007-03-01 Thread Talbot Katz
Hi. Here's an odd request that actually arose out of my own bad planning. Suppose I do the following: which(v1 %in% v2) I will get a set of indices for v1, and they will be ordered in the same order that v1 is in. I want the indices of the intersection for v1 ordered according to v2. I do

[R] Efficient way to repeat rows (or columns) of a matrix?

2007-02-28 Thread Talbot Katz
Hi. If I have a vector, v_1, and another vector of positive integers, i_1, the same length as v_1, then rep(v_1,i_1) will repeat v_i[j] exactly i_1[j] times, like so: rep(c(1,2,3),c(3,2,1)) [1] 1 1 1 2 2 3 I'd like to do the same sort of thing where I replace v_1 with a matrix, and the jth

Re: [R] Efficient way to repeat rows (or columns) of a matrix?

2007-02-28 Thread Talbot Katz
Brilliant, thanks! -- TMK -- 212-460-5430home 917-656-5351cell From: James W. MacDonald [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] Efficient way to repeat rows (or columns) of a matrix? Date: Wed, 28 Feb 2007 18:20:32 -0500 Hi

Re: [R] Function to assign quantiles?

2007-02-16 Thread Talbot Katz
PROTECTED] CC: [EMAIL PROTECTED], r-help@stat.math.ethz.ch, Talbot Katz [EMAIL PROTECTED] Subject: Re: [R] Function to assign quantiles? Date: Fri, 16 Feb 2007 19:51:49 +1300 On 2/16/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote: Marc Schwartz wrote: On Thu, 2007-02-15 at 17:50 -0500, Talbot Katz

[R] Function to assign quantiles?

2007-02-15 Thread Talbot Katz
Hi. If I call the quantiles function as follows: qvec = quantiles(dvals,probs=seq(0,1,0.1)) the results will return a vector something like the following example: 0%10%20%30% 40% 50%60%70% 80% 90% 100% 56.0 137.3 238.4 317.9 495.8

Re: [R] Questions about results from PCAproj for robust principal component analysis

2007-02-14 Thread Talbot Katz
Professor Filzmoser. Thank you so much for the detailed response. It is very helpful. -- TMK -- 212-460-5430home 917-656-5351cell From: Peter Filzmoser [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: Questions about results from PCAproj

[R] Questions about results from PCAproj for robust principal component analysis

2007-02-13 Thread Talbot Katz
Hi. I have been looking at the PCAproj function in package pcaPP (R 2.4.1) for robust principal components, and I'm trying to interpret the results. I started with a data matrix of dimensions RxC (R is the number of rows / observations, C the number of columns / variables). PCAproj returns a

[R] Local R Users Groups?

2007-02-09 Thread Talbot Katz
Hi. I have only recently become a regular R user, and have already benefited from the R-help list (Thank you!). I have spent many years in the SAS world (insert your own sassy remark here), which has its own very nice users list site (http://listserv.uga.edu/archives/sas-l.html), plus users

Re: [R] Another loop - deloop question

2007-02-05 Thread Talbot Katz
Thank you so much! This is super helpful, even if it turns out that vectorization doesn't improve performance in my situation. -- TMK -- 212-460-5430home 917-656-5351cell From: Charles C. Berry [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject

Re: [R] Can this loop be delooped?

2007-02-02 Thread Talbot Katz
is an exact multiple of the number of groups). -- TMK -- 212-460-5430home 917-656-5351cell From: Kaskelma, Heikki [EMAIL PROTECTED] To: jim holtman [EMAIL PROTECTED],Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: RE: [R] Can this loop be delooped? Date: Fri, 2 Feb

[R] Another loop - deloop question

2007-02-02 Thread Talbot Katz
Hi. You folks are so clever, I thought perhaps you could help me make another procedure more efficient. Right now I have the following setup: p is a vector of length m g is a list of length n, g[[i]] is a vector whose elements are indices of p, i.e., integers between 1 and m inclusive); the

[R] Can this loop be delooped?

2007-02-01 Thread Talbot Katz
Hi. I have the following code in a loop. It splits a vector into subvectors of equal size. But if the size of the original vector is not an exact multiple of the desired subvector size, then the first few subvectors have one more element than the last few. I know that the cut function could

[R] Residual variance from rlm?

2007-01-26 Thread Talbot Katz
Hi. This is a real basic question about results from rlm. I want to compute the properly scaled residual variance. Suppose M is my rlm result object; my example regression is against two variables, and based on 225 observations. summary(M) tells me that Residual standard error: 0.0009401 on

[R] cov.nnve error message

2007-01-23 Thread Talbot Katz
Hi. I have a data matrix of size 3072x1910. I can compute a standard 1910x1910 covariance matrix for this, and it comes out positive definite. I wanted to compute a robust covariance matrix with cov.nnve (in the covRobust library). It failed with the following error message: Error in

[R] Robust PCA?

2007-01-18 Thread Talbot Katz
Hi. I'm checking into robust methods for principal components analysis. There seem to be several floating around. I'm currently focusing my attention on a method of Hubert, Rousseeuw, and Vanden Branden (http://wis.kuleuven.be/stat/Papers/robpca.pdf) mainly because I'm familiar with other

Re: [R] Robust PCA?

2007-01-18 Thread Talbot Katz
Hi Bert. Thank you, that sounds like an excellent idea. After my initial post, I also found an implementation of ROBPCA in S-PLUS at (http://wis.kuleuven.be/stat/robust/programs.html). -- TMK -- 212-460-5430home 917-656-5351cell From: Bert Gunter [EMAIL PROTECTED] To: 'Talbot Katz

[R] rank function and NA in 2.3.1

2007-01-11 Thread Talbot Katz
Hi. I am using R 2.3.1 on WIndows XP, and I am having trouble with the rank function in the presence of numerical NA data. I want the NA's all to get the same rank, but they don't. Here is an example from my session: ct_align_rets_f2$liq[6851:6859] [1] 115396 NA 362595 NA 242986

[R] na.action and simultaneous regressions

2007-01-03 Thread Talbot Katz
Hi. I am running regressions of several dependent variables using the same set of independent variables. The independent variable values are complete, but each dependent variable has some missing values for some observations; by default, lm(y1~x) will carry out the regressions using only the

Re: [R] na.action and simultaneous regressions

2007-01-03 Thread Talbot Katz
variables separately with respect to missing values wasn't included. Thanks! -- TMK -- 212-460-5430home 917-656-5351cell From: Bert Gunter [EMAIL PROTECTED] To: 'Talbot Katz' [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: RE: [R] na.action and simultaneous regressions Date: Wed, 3

[R] Failure loading library into second R 2.3.1 session on Windows XP

2006-12-29 Thread Talbot Katz
Hi. I am using R 2.3.1 on Windows XP. I had installed a library package into my first session and wanted the same package in my second session, so I went out to the CRAN mirror and tried to install the package, and got the following message:

Re: [R] Failure loading library into second R 2.3.1 session on Windows XP

2006-12-29 Thread Talbot Katz
cell From: Uwe Ligges [EMAIL PROTECTED] To: Talbot Katz [EMAIL PROTECTED] CC: r-help@stat.math.ethz.ch Subject: Re: [R] Failure loading library into second R 2.3.1 session on Windows XP Date: Fri, 29 Dec 2006 23:05:15 +0100 You can only expect that update / reinstall a ***package*** works