Re: [R] Limited number of principal components in PCA

2011-08-04 Thread William Armstrong
David and Josh, Thank you for the suggestions. I have attached a file ('q_values.txt') that contains the values of the 'Q' variable. David -- I am attempting an 'S' mode PCA, where the columns are actually the cases (different stream gaging stations) and the rows are the variables (the maximum f

[R] Limited number of principal components in PCA

2011-07-29 Thread William Armstrong
Hi all, I am attempting to run PCA on a matrix (nrow=66, ncol=84) using 'prcomp' (stats package). My data (referred to as 'Q' in the code below) are separate river streamflow gaging stations (columns) and peak instantaneous discharge (rows). I am attempting to use PCA to identify regions of that

Re: [R] Writing Complex Formulas

2011-07-15 Thread William Armstrong
Forgive me. I had a legitimate problem that I found resolvable using "**" instead of "^". I can't seem to recreate the problem to obtain the error message that I was receiving. "Incomplete information" is perhaps more appropriate than "*mis*information." Here is the exact code I used (still not

[R] computing functions with Euler's number (e^n)

2011-07-08 Thread William Armstrong
I am trying to create a set of wavelets in frequency space--namely Cauchy wavelets for an intensity analysis (von Tscharner, 2000). The wavelets are defined by the following formula: [(f/cf)^(cf*scale)]*[e^((-f/cf)+1)^(cf*scale)] where *f *is frequency of length *n*, *cf* is center frequency (de

[R] Writing Complex Formulas

2011-07-01 Thread William Armstrong
I am trying to create a set of wavelets in frequency space--namely Cauchy wavelets for an intensity analysis (von Tscharner, 2000). The wavelets are defined by the following formula: [(f/cf)^(cf*scale)]*[e^((-f/cf)+1)^(cf*scale)] where *f *is frequency of length *n*, *cf* is center frequency (de

Re: [R] Sorting a data frame with values of different lengths

2011-06-07 Thread William Armstrong
Thanks for catching that, Sarah. It seems like the problem was that I was using the c() function to combine terms (including W) that I was adding to a data frame. This caused R to convert the numeric W to a character string. I fixed this by using data.frame() and then rbind() instead of c() and

Re: [R] Sorting a data frame with values of different lengths

2011-06-07 Thread William Armstrong
Also, I tried changing a line to store W as numeric: sample_info<-c(pds_gagehandles[i],p,as.numeric(sample_W)) But it is still sorting incorrectly: > W_table[order(W_table$as.numeric.W.),] pds_gagehandles.i. p as.numeric.W. 8mibe 81004.5 1mibe 1

Re: [R] Sorting a data frame with values of different lengths

2011-06-07 Thread William Armstrong
Hi Sarah, str(W_table) gives me: > str(W_table) 'data.frame': 11 obs. of 3 variables: $ pds_gagehandles.i.: Factor w/ 1 level "mibe": 1 1 1 1 1 1 1 1 1 1 ... $ p : chr "1" "2" "3" "4" ... $ W : chr "746" "870.5" "767" "1066" ... here is the script I am usi

[R] Sorting a data frame with values of different lengths

2011-06-07 Thread William Armstrong
Hi all, I am attempting to run a script in which I permute my data and run a Wilcoxon rank sum test on the data 1000 times and compare my original test statistic to the permuted test statistics to more accurately estimate a significance level for the trends I am observing. In the process of doing