Re: [R] sum(hist$density) == 2 ?!

2012-03-14 Thread Jeff Newmiller
Your clue is... density! Probability density is not the same as probability... you have to multiply it by something before you can sum it. Try typing h by itself and review your options. --- Jeff Newmiller

[R] Merging fully overlapping groups

2012-03-14 Thread mdvaan
Hi, I have data on individuals (B) who participated in events (A). If ALL participants in an event are a subset of the participants in another event I would like to remove the smaller event and if the participants in one event are exactly similar to the participants in another event I would like

[R] Re : ROC Analysis

2012-03-14 Thread Pascal Oettli
Hi Camille, Do you need something like that? ### library(ROCR) data(ROCR.simple) pred - prediction(ROCR.simple$predictions, ROCR.simple$labels) tpf - unlist(performance(pred,tpr)@y.values) tnf - unlist(performance(pred,tnr)@y.values) x - rev(unlist(pred@cutoffs)) plot(x,

Re: [R] Help with plot Grouped Bar Plot by using R

2012-03-14 Thread R_beginner_starter
Thanks a lot, Jim. I get my desired output by using your R script at the end Yesterday was my mistake Apart from that, do you have any idea to plot a line graph/chart? My Input file is shown as below: Range Data1 Data2 1 38 37 2 38 37 3 38 37 4 37

[R] Problem installing RMySQL package!

2012-03-14 Thread AGGARWAL, NEERAJ (NEERAJ)
I am facing issues while installing RMySQL package on windows(32 bit) installation of R-Project. I am getting the following warning messages. Warning messages: 1: running command 'C:/PROGRA~1/R/R-213~1.2/bin/i386/R CMD INSTALL -l C:/Program Files/R/R-2.13.2/library

[R] Questing on fitting Baseline category Logit model

2012-03-14 Thread Christofer Bogaso
Dear all, I am facing some problem with how to fit a Baseline category Logit model with R. Basically I am considering famous Alligator data as discussed by Agresti. This data can also be found here: https://onlinecourses.science.psu.edu/stat504/node/174 (there is also an accompanying R file,

[R] Re : sum(hist$density) == 2 ?!

2012-03-14 Thread Pascal Oettli
Hi Sam, ?hist gives: density     values f^(x[i]), as estimated density values. If all(diff(breaks) == 1), they are the relative frequencies counts/n and in general satisfy sum[i; f^(x[i]) (b[i+1]-b[i])] = 1, where b[i] = breaks[i]. 1st case,  density != frequency because all(diff(breaks) ==

[R] cannot load shared object /usr/lib/R/library/grDevices/libs//cairo.so

2012-03-14 Thread beltrand
Hi, I am trying to test out the scripts here as a proof of concept http://www.r-bloggers.com/integrating-php-and-r/ However, I am not able to reproduce the output graph in the browser. Rscripts is working fine as I run the command Rscript /home/username/R/testscript.R 1000 for example, and a

Re: [R] how to find best model of time series?giving error

2012-03-14 Thread sagarnikam123
yes but giving error t-read.table(file.choose()) t-ts(t) plot(t) Hit Return to see next plot: ht-HoltWinters(t) Error in decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal) : time series has no or less than 2 periods what should i do? -- View this message in context:

[R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Lazarus Mramba
Dear all, I have a large matrix with about 2500 variables, and 100 rows. I would like to calculate the means of the every 10 variables starting from 1:2500 and saving the results as a vector or matrix. How can I do that? Alternatively, How can I create 250 subset matrices in the order of

[R] Apply a loop containing a function on a list

2012-03-14 Thread ali_protocol
Hi all, I want to do this: B.list$aa= (a loop containing My.fun acting on the reults of second function on a A.list$aa)) or, overally B.list$aa = function (A.list$aa) B.list and A.list has many sublists aa, ab and Is there a way I can apply the function and

Re: [R] reshaping a dataset for a network

2012-03-14 Thread Marco Guerzoni
Thank you fro the reply. I managed to arrive till here, then I would like to have it in matrix where the $1 $2...$5 are the first column. Il 3/13/2012 8:15 PM, William Dunlap ha scritto: Is the following what you want? a- c(1,2,3,4,4,4,5,5) b- c(11,7,4,9,8,3,12,4) split(b, a)

Re: [R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Tsjerk Wassenaar
Hi Lazarus, Checkout arrays (?array). You can cast your matrix to an array of submatrices, and calculate the means per block using apply. Cheers, Tsjerk On Mar 14, 2012 9:25 AM, Lazarus Mramba lmra...@gmail.com wrote: Dear all, I have a large matrix with about 2500 variables, and 100 rows.

[R] Partial Canonical Correlation Analysis Help

2012-03-14 Thread Proitsi, Petroula
Hello, I am trying to perform partial Canonical Correlation (CCA) in R. I have calculated the CCA between two vectors X and Y and now I want to control for Z. I know I have to modify the cc and rcc functions to include Z but what I am doing does not seem to be working... Below I have the

Re: [R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Petr Savicky
On Wed, Mar 14, 2012 at 03:22:39AM -0400, Lazarus Mramba wrote: Dear all, I have a large matrix with about 2500 variables, and 100 rows. I would like to calculate the means of the every 10 variables starting from 1:2500 and saving the results as a vector or matrix. How can I do that?

Re: [R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Tsjerk Wassenaar
Hi Lazarus, Sorry for my brevity before. I sent it from a phone. # Generate dummy data matrix x - matrix(1:100,nrow=5) # Rearrange into array; ten groups of two columns y - array(x,c(5,2,10)) # Average columns for each submatrix apply(y,c(1,3),mean) # Average per submatrix apply(y,3,mean)

Re: [R] Idea/package to linearize a curve along the diagonal?

2012-03-14 Thread Yvonnick Noel
I am trying to normalize some data. First I fitted a principal curve (using the LCPM package), but now I would like to apply a transformation so that the curve becomes a straight diagonal line on the plot. The data used to fit the curve would then be normalized by applying the same

[R] [R-pkgs] diveMove 1.3.1

2012-03-14 Thread Sebastian P. Luque
Version 1.3.1 of diveMove is now available on CRAN. Changes since previous version (1.2.9) are: o Improved formatting of code in vignette. Figure resolution reduced to satisfy package check requirements. o At least R 2.13.0 is required. o Dives occurring in trivial wet periods

Re: [R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Tsjerk Wassenaar
Hi Lazarus, You should use apply, not sapply. a =matrix(1:12, nrow=2,ncol=6,byrow=TRUE) b = array(a,c(2,2,3));b colMeans(b) f1=function(x) sum(x)/length(row(a.df[,1:2])) y3 - apply(b, 1, f1) It only gives one matrix with only two values, I expected 3 values. To apply the function on

Re: [R] how to find best model of time series?giving error

2012-03-14 Thread Berend Hasselman
On 14-03-2012, at 07:22, sagarnikam123 wrote: yes but giving error t-read.table(file.choose()) t-ts(t) plot(t) Hit Return to see next plot: ht-HoltWinters(t) Error in decompose(ts(x[1L:wind], start = start(x), frequency = f), seasonal) : time series has no or less than 2 periods

Re: [R] Help with plot Grouped Bar Plot by using R

2012-03-14 Thread Bert Gunter
Please stop asking such basic questions on this list and start reading An Intro to R (ships with R) or any other beginning R tutorial. It seems to me to be impolite to pester this list for beginners' instructions without first having made at least a minimal effort to to familiarize yourself with R

Re: [R] Creating 250 submatrices from a large single matrix with 2500 variables using loops

2012-03-14 Thread Bert Gunter
?? Petr's solution is shorter and for large problems considerably faster... -- Bert On Wed, Mar 14, 2012 at 2:08 AM, Tsjerk Wassenaar tsje...@gmail.com wrote: Hi Lazarus, Sorry for my brevity before. I sent it from a phone. # Generate dummy data matrix x - matrix(1:100,nrow=5) #

Re: [R] Problem installing RMySQL package!

2012-03-14 Thread S Ellison
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of AGGARWAL, NEERAJ (NEERAJ) Sent: 14 March 2012 05:14 To: r-help@r-project.org Subject: [R] Problem installing RMySQL package! I am facing issues while installing RMySQL

Re: [R] Apply a loop containing a function on a list

2012-03-14 Thread Milan Bouchet-Valat
Le mercredi 14 mars 2012 à 00:51 -0700, ali_protocol a écrit : Hi all, I want to do this: B.list$aa= (a loop containing My.fun acting on the reults of second function on a A.list$aa)) or, overally B.list$aa = function (A.list$aa) B.list and A.list has many

[R] Creating polygons from scattered points

2012-03-14 Thread Louise Mair
Hello, I have a distribution dataset for species consisting of xy coordinates at the 1km resolution, with only presence data. So a simplified example of a species distribution might be: y - rbind(as.integer(rnorm(100,50,20)), as.integer(rnorm(200,100,30)), as.integer(rnorm(100,180,15))) x -

[R] Moore-Penrose Generalized determinant?

2012-03-14 Thread Sean O'Riordain
Is there a function in R to calculate the generalized determinant of a singular matrix? - similar to the ginv() used to compute the generalized inverse. I can't seem to find any R related posts at all. Thanks in advance, Sean O'Riordain Trinity College Dublin -- View this message in context:

Re: [R] multi-histogram plotting

2012-03-14 Thread R. Michael Weylandt
It's easier to do log plots as plot(h$density, log = L) where L is one of x, y, or xy as you choose. This is well documented. Michael On Wed, Mar 14, 2012 at 12:02 AM, Sam Steingold s...@gnu.org wrote: * David Winsemius qjvafrz...@pbzpnfg.arg [2012-03-13 17:53:14 -0400]: On Mar 13, 2012, at

Re: [R] reshaping a dataset for a network

2012-03-14 Thread R. Michael Weylandt
You can't have empty spots like that in an array. One choice would be to fill them with NAs: library(plyr) do.call(rbind.fill.matrix,lapply(split(b,a), t)) Michael On Wed, Mar 14, 2012 at 4:01 AM, Marco Guerzoni marco.guerz...@unito.it wrote: Thank you fro the reply. I managed to arrive till

Re: [R] Problem installing RMySQL package!

2012-03-14 Thread R. Michael Weylandt
In addition to Dr. Ellison's sound advice, as the link says: follow the provided link, go to a CRAN mirror (http://cran.r-project.org/mirrors.html), click download for windows and Rtools will be available. Michael On Wed, Mar 14, 2012 at 1:14 AM, AGGARWAL, NEERAJ (NEERAJ)

Re: [R] Creating polygons from scattered points

2012-03-14 Thread R. Michael Weylandt
This might be a question for the R-SIG-Geo or R-SIG-Ecology lists. Best, Michael On Wed, Mar 14, 2012 at 7:13 AM, Louise Mair lm...@york.ac.uk wrote: Hello, I have a distribution dataset for species consisting of xy coordinates at the 1km resolution, with only presence data. So a simplified

Re: [R] Problem installing RMySQL package!

2012-03-14 Thread Gabor Grothendieck
On Wed, Mar 14, 2012 at 1:14 AM, AGGARWAL, NEERAJ (NEERAJ) neeraj.aggar...@alcatel-lucent.com wrote: I am facing issues while installing RMySQL package on windows(32 bit) installation of R-Project. I am getting the following warning messages. Warning messages: 1: running command

Re: [R] Creating polygons from scattered points

2012-03-14 Thread Keith Jewell
No time to really think about this, but: a) to convert scattered point distributions to polygons you might look at convex hulls; e.g. convhulln {geometry} b) to identify islands some kind of cluster analysis Hope that helps a little. KJ Louise Mair lm...@york.ac.uk wrote in message

[R] How to extend a slot of a class?

2012-03-14 Thread Marco Smolla
Hej hej, is there a way to extend the SpatialPointsDataFrame data slot?This is the structure of an object of it: str(coord) Formal class 'SpatialPointsDataFrame' [package sp] with 5 slots ..@ data :'data.frame': 214 obs. of 2 variables: .. ..$ location.long: num [1:214] -79.8 -79.8

Re: [R] ROC Analysis

2012-03-14 Thread Camille Leclerc
Hi, Pascal, I tried to use your method which functions but the values of the abscissa are not good. When I talked about “value”, I wanted mean the values of my starting dataset that I have classified into two classes positive and negative classes, such as this : Value Status TPF

[R] plm function

2012-03-14 Thread Ieva Sriubaitė
Dear Sir/ Madam, I am writing about the panel data for my bachelor degree. I would really appreciate if You could help dealing with R functions. I am trying to estimate the panel data lm model with plm function. When i include 3dummy variables into the regression it dont appear in the sumarry of

Re: [R] beginner's loop issue

2012-03-14 Thread aledanda
Thank you all for your helpful comments! I solved my problem by creating an empty matrix before the loop and adjusting the loop itself, this is the code: size - dim(input) out - matrix('',nrow =size[1], ncol = 9) for (i in 1:nrow(input)) { out[i,1:3] -

Re: [R] Sum results in a matrix

2012-03-14 Thread RMSOPS
thank you It is working, a question in the wake of the array. with the following code I am creating a data frame to store the data without repeating the code is working. The question is the best way to do this process in R tab-NULL for(i in 1: nrow(res4)) { for(j in i:nrow(res4)) {

Re: [R] reshaping a dataset for a network

2012-03-14 Thread Marco Guerzoni
thank you very much I had managed with df - data.frame(a,b) m - lapply(split(df, df$a), function(x) x$b) n - max(sapply(m, length)) a - t(sapply(m, function (x) c(x, rep(NA, n - length(x) but your solution is much more elegant. best regards Marco Il 3/14/2012 1:54 PM, R. Michael Weylandt

[R] not saving plot with resizable size?

2012-03-14 Thread sagarnikam123
i want to save plots in batch mode(100 plots in single code) in resizable mode which format should i use,i m working on windows savePlot(zatka,type=pdf,device=dev.cur()) Error in savePlot(zatka, type = pdf, device = dev.cur()) : can only copy from 'windows' devices -- View this message in

[R] R course: London, Monday 18th - Friday 22nd June 2012.

2012-03-14 Thread Leonard Schalkwyk
r-help readers may be interested in our week-long summer school 'Introduction to R'. Further details including links to the course materials from last year and the application form are at: http://www.kcl.ac.uk/schools/summerschool/si/sgdp/course2/ The course is presented by the MRC Social,

[R] Real-Time data transfer from Excel to R

2012-03-14 Thread burcy
Hi All I receive through DDE ,real time data from an external supplier on an Excel 2003 sheet. I use R as platform to make backtest trading and prepare trade. My question : Is existing a solution to transfer real-time data from Excel to R? Such transfer keeping the streaming condition. I don't

Re: [R] sort list

2012-03-14 Thread sybil kennelly
I appreciate the reading Thank you. May i ask one final question. If i have: matrix: var1var2 var3 cell1x x x cell2x x x cell3x x x cell4 . . . . cell100 and: vector1 - c(cell1, cell5,cell19, cell50, cell70)

[R] geom_plot creates Area Instead Of Lines

2012-03-14 Thread kyleR
Hi, I have created a large (?) data frame. I have one variable to plot, lets call it X. further X has been observed under conditions Y, Z. And the observation took place at times T (0:10e5). Now my data frame D consists of x,y,z,t each corresponding to the combination of X, Y, Z and T. I would

[R] list factoring

2012-03-14 Thread sybil kennelly
Hi Guys, this is actually a thread of emails, but for some reason, even though i am a member, it's withholding my email so i said i would try it this route instead!... I appreciate the reading Thank you. If i have: matrix: var1var2 var3 cell1x x x cell2x

[R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Next, here's the code I want to impose (error that I'm seeing SHOULD reproduce on your shell when script is executed...btw using Ubuntu Linux 11.10 if that makes a

[R] random effect of species in lme on slope taking into account two variables

2012-03-14 Thread Bhogal, Harkiran
Hi! Just wondering how you would change this code so i can look at the random effect of species on slopes of effect of logM (body mass) and K (temperature) together. I did this so far: model1-lme(logSSP~logM + K,random=~1|species,data=data1) #random effect of spp on intercept

[R] how to calculate AIC value from below values using time series model

2012-03-14 Thread sagarnikam123
t -0.15264004 0.056076439 -0.07276116 -0.00917326 -0.02069089 -0.00416232 -0.07225855 -0.02654577 -0.06131410 -0.09380202 0.057414014 -0.05239976 0.014397612 0.016145161 -0.00670587 0.018696335 0.036943654 -0.02450233 0.031161705 0.006513503 -0.02892329 -0.00831519

Re: [R] how to find best model of time series? calculate aic value, if i have

2012-03-14 Thread sagarnikam123
yes,but i want AIC value to calculate for below value, using frequency =1 in ts() function t -0.15264004 0.056076439 -0.07276116 -0.00917326 -0.02069089 -0.00416232 -0.07225855 -0.02654577 -0.06131410 -0.09380202 0.057414014 -0.05239976 0.014397612 0.016145161 -0.00670587

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-14 Thread pie'
Hi, I took a look at the documentation concerning rollapply and it doesnt seem to be the command I need. Just to be more clear, on an initial sample of 80 observations I want to perform a probit regression and save the fitted probabilities in a vector. Subsequently another probit is run on the

Re: [R] not saving plot with resizable size?

2012-03-14 Thread R. Michael Weylandt
Just plot directly to your desired output device and don't try to copy. pdf(outfilename.pdf) # lots of plots dev.off() and everything will come out in a single pdf Michael On Wed, Mar 14, 2012 at 6:44 AM, sagarnikam123 sagarnikam...@gmail.com wrote: i want to save plots in batch mode(100

[R] aggregate

2012-03-14 Thread Alaios
Dear all I am having a vector with large length and I would like to ask you if I can aggregate the values by constant sized windows. For example for the following vector, I would like to take 30 points until the end and find their mean. myData-seq(1:10)

[R] where I can find more color names or color definition?

2012-03-14 Thread Jie Tang
hi everyone . Now I want to draw several lines in one frame.And it seems needs more colors except for blue red,black .Where can i found these color name or define some new color ?thank you . -- TANG Jie Email: totang...@gmail.com Tel: 0086-2154896104 Shanghai Typhoon Institute,China

[R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
Hello, How do I plot a gam fit object on probability (Y axis) vs raw values (X axis) axis and include the confidence plot lines? Details... I'm using the gam function like this: l_yx[,2] = log(l_yx[,2] + .0004) fit - gam(y~s(x),data=as.data.frame(l_yx),family=binomial) And I want to plot it so

Re: [R] Sum results in a matrix

2012-03-14 Thread Petr Savicky
On Wed, Mar 14, 2012 at 02:28:22AM -0700, RMSOPS wrote: thank you It is working, a question in the wake of the array. with the following code I am creating a data frame to store the data without repeating the code is working. The question is the best way to do this process in R

Re: [R] Moore-Penrose Generalized determinant?

2012-03-14 Thread JLucke
If the matrix is singular, the determinant of the matrix and its M-P inverse are both zero. Sean O'Riordain sean...@acm.org Sent by: r-help-boun...@r-project.org 03/14/2012 07:41 AM To r-help@r-project.org cc Subject [R] Moore-Penrose Generalized determinant? Is there a function in R

[R] help with expression

2012-03-14 Thread Thomas Hoffmann
Hi all, I still fail to plot an axis title with the following expression: plot(0,xlab=expression('(SOC [' * kgm^{-2} * '])' * ^{-2})) the xlab should look like: (SOC [kgm^2])^0.25 with an out bracket and a superscript. Thanks for your advice. Thomas [[alternative HTML version

[R] How to use a saved SVM model from e1071

2012-03-14 Thread Thomas Coffin
Hello, I have an SVM model previously calibrated using libsvm R implementation from the e1071 package. I would like to use this SVM to predict values, from a Java program. I first tried to use jlibsvm and the standard java implementation of libsvm, without success. Thus, I am now considering

Re: [R] aggregate

2012-03-14 Thread Petr Savicky
On Wed, Mar 14, 2012 at 07:46:40AM -0700, Alaios wrote: Dear all I am having a vector with large length and I would like to ask you if I can aggregate the values by constant sized windows. For example for the following vector, I would like to take 30 points until the end and find their mean.

Re: [R] where I can find more color names or color definition?

2012-03-14 Thread R. Michael Weylandt
apropos(color) ?colors colors() Michael On Wed, Mar 14, 2012 at 10:55 AM, Jie Tang totang...@gmail.com wrote: hi everyone .  Now I want to draw several lines in one frame.And it seems needs more colors except for blue red,black .Where can i found these color name or define some new color

Re: [R] how to find best model of time series? calculate aic value, if i have

2012-03-14 Thread Berend Hasselman
On 14-03-2012, at 13:00, sagarnikam123 wrote: yes,but i want AIC value to calculate for below value, using frequency =1 in ts() function t -0.15264004 0.056076439 -0.07276116 -0.00917326 -0.02069089 -0.00416232 -0.07225855 -0.02654577 -0.06131410 -0.09380202 0.057414014

Re: [R] where I can find more color names or color definition?

2012-03-14 Thread Jorge I Velez
Hi, One way would be to type colors() and choose your favorite(s) ;-) HTH, Jorge.- On Wed, Mar 14, 2012 at 10:55 AM, Jie Tang wrote: hi everyone . Now I want to draw several lines in one frame.And it seems needs more colors except for blue red,black .Where can i found these color name

Re: [R] where I can find more color names or color definition?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 10:55 AM, Jie Tang wrote: hi everyone . Now I want to draw several lines in one frame.And it seems needs more colors except for blue red,black .Where can i found these color name or define some new color ?thank you . When you have a question, your first thought should

Re: [R] Moore-Penrose Generalized determinant?

2012-03-14 Thread Berend Hasselman
On 14-03-2012, at 12:41, Sean O'Riordain wrote: Is there a function in R to calculate the generalized determinant of a singular matrix? - similar to the ginv() used to compute the generalized inverse. I can't seem to find any R related posts at all. Is this what you want:

Re: [R] Moore-Penrose Generalized determinant?

2012-03-14 Thread Ranjan Maitra
Since the OP says Generalized determinant (I do not really know what that means), it is different from the usual determinant perhaps? Is it the product of the nonzero eigenvalues? Ranjan On Wed, 14 Mar 2012 10:52:14 -0400 jlu...@ria.buffalo.edu wrote: If the matrix is singular, the

Re: [R] Questing on fitting Baseline category Logit model

2012-03-14 Thread Michael Friendly
Not sure why VGAM::vglm doesn't work here, but most likely it is the small zero counts cited on the page you quote below. This data set is very sparse. You should communicate with the author of VGAM. You can fit this model with nnet::multinom instead, something like library(nnet) #

Re: [R] How to use a saved SVM model from e1071

2012-03-14 Thread Steve Lianoglou
Hi Thomas, On Wed, Mar 14, 2012 at 11:00 AM, Thomas Coffin thomas.cof...@artelys.com wrote: Hello, I have an SVM model previously calibrated using libsvm R implementation from the e1071 package. I would like to use this SVM to predict values, from a Java program. I first tried to use

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 7:57 AM, knavero wrote: Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. Next, here's the code I want to impose (error that I'm seeing SHOULD reproduce on your shell when

[R] How to test the statistical significance of the difference of two univariate Linear Regression betas?

2012-03-14 Thread Michael
How to test the statistical significance of the difference of two univariate Linear Regression betas? Hi all, There are two samples of data: D1 and D2. On data D1 we do a univariate Linear Regression and get the coefficient beta1. On data D2 we do a univariate Linear Regression and get the

Re: [R] where I can find more color names or color definition?

2012-03-14 Thread R. Michael Weylandt
Here's a function I stole from a blog post somewhere (I forgot where and I'm pressed for time, but I'm sure google can recover it) -- it might be helpful to you: `col.wheel` - function(str, nearby=3, cex=0.75) { cols - colors() hsvs - rgb2hsv(col2rgb(cols)) srt -

[R] How to use ggplot to do the binned quantile plots(one type of scatter plot)?

2012-03-14 Thread Michael
How to use ggplot to do the binned quantile plots(one type of scatter plot)? Hi all, I have done scatter plot: plot(x, y). Now I wanted to do binned quantile plots... can ggplot2 help me? For example, we bin x data into 10 bins. For each bin, we draw the 10 deciles of the corresponding y data

[R] extract values ​​for the dates and a new column

2012-03-14 Thread RMSOPS
#add column Start Hello Good Afternoon I am trying to create a new column in the data frame, the target is based on a column of dates to extract a value of life and add a new column to data frame f-x.res$T-x.res$duration Dataset$StarEvent-(as.character.POSIXt(f)) x.sub$T is: [1] 2006-10-31

Re: [R] reshaping a dataset for a network

2012-03-14 Thread William Dunlap
I see you have a solution, but why do you want the results of split() in matrix form? E.g., does it make a nicer printout, is it needed to interface with other R functions, is it needed to interface with other software? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original

Re: [R] How to use ggplot to do the binned quantile plots(one type of scatter plot)?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 11:33 AM, Michael wrote: How to use ggplot to do the binned quantile plots(one type of scatter plot)? More like a quantile regression plot. Hi all, I have done scatter plot: plot(x, y). Now I wanted to do binned quantile plots... can ggplot2 help me? For example,

Re: [R] help with expression

2012-03-14 Thread ilai
On Wed, Mar 14, 2012 at 8:56 AM, Thomas Hoffmann hoffm...@giub.uni-bonn.de wrote: Hi all, I still fail to plot an axis title with the following expression: plot(0,xlab=expression('(SOC [' * kgm^{-2} * '])' * ^{-2})) the xlab should look like:   (SOC [kgm^2])^0.25 with an out bracket and a

Re: [R] Real-Time data transfer from Excel to R

2012-03-14 Thread Richard M. Heiberger
Yes. please look at RExcel. You can download it from rcom.univie.ac.at The wiki page there has many papers discussing similar projects (follow the Literature link in the left column). Followup should be on the rcom mailing list. Rich On Wed, Mar 14, 2012 at 7:12 AM, burcy

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
The outputs that I'm getting, however, are printing out 0's down the columns. I've tried various methods assuming various theories, read the R manual via ? for different possible solutions, Googled stuff, tried the ifelse function which produces the same error, tried creating logical

Re: [R] How to use ggplot to do the binned quantile plots(one type of scatter plot)?

2012-03-14 Thread Clint Bowman
?quantile on the individual bins, make your deciles, then plot the ten series as usual with your x values at the midpoint of the bins. Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology

Re: [R] extract values ​​for the dates and a new column

2012-03-14 Thread Jeff Newmiller
The error seems clear enough to me... you are trying to mix vectors of different lengths where one length is not a multiple of the other length. Your discussion is pretty confused though, referring to possible data frames x, x.sub, x.res and Dataset. You might benefit from reviewing ?str and

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. ^ Clicking on the link should prompt you to download a csv file and save it somewhere in your HDD. -- View this message in context:

Re: [R] MANOVA and Extra Sums-of-Squares Tests

2012-03-14 Thread chris33
Hi John, Thanks again. That looks like an easy and convenient approach. Regards, Chris -- View this message in context: http://r.789695.n4.nabble.com/MANOVA-and-Extra-Sums-of-Squares-Tests-tp4470077p4472265.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] help with expression

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 11:53 AM, ilai wrote: On Wed, Mar 14, 2012 at 8:56 AM, Thomas Hoffmann hoffm...@giub.uni-bonn.de wrote: Hi all, I still fail to plot an axis title with the following expression: plot(0,xlab=expression('(SOC [' * kgm^{-2} * '])' * ^{-2})) the xlab should look like:

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread David Winsemius
On Mar 14, 2012, at 11:47 AM, knavero wrote: Here's the raw data I'm working with (will be available temporarily): http://dl.dropbox.com/u/41922443/dataout_2471_843.csv Nothing appears. ^ Clicking on the link should prompt you to download a csv file and save it somewhere in your

Re: [R] Amount of memory occupied by data type

2012-03-14 Thread Folkes, Michael
Thanks David for the details and pointer to bitops functions. Buried a bit deep that was. I like to think the memory constraints of win xp keeps my code lean and efficient. RAM is like a suburban garage, the bigger it is, the more useless junk people stuff in there. Michael Folkes

Re: [R] How to test the statistical significance of the difference of two univariate Linear Regression betas?

2012-03-14 Thread Mark Leeds
Hi: I'm jot sure if it's exactly what you want but check out Hotelling's paper from 1940. It should be in the archives because I answered this question before ( not from you ). If you can't find it, I'll find the title actually, here's the title: Hotelling, The Selection of Variates For Use

Re: [R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Patrick Breheny
The predict() function has an option 'se.fit' that returns what you are asking for. If you set this equal to TRUE in your code: pred - predict(fit,data.frame(x=xx),type=response,se.fit=TRUE) will return a list with two elements, 'fit' and 'se.fit'. The pointwise confidence intervals will

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
You're missing a comma between 0 and ] in the last line if your goal is to retrieve the rows that satisfy that condition (and if the condition makes any sense). Haven't tested the rest of your code, though. ?Extract The outputs that I'm getting, however, are printing out 0's down the

Re: [R] reshaping a dataset for a network

2012-03-14 Thread Marco Guerzoni
Il 3/14/2012 4:43 PM, William Dunlap ha scritto: I see you have a solution, but why do you want the results of split() in matrix form? E.g., does it make a nicer printout, is it needed to interface with other R functions, is it needed to interface with other I need matrix to export the data in

Re: [R] logical test not functioning correctly on zoo series...what the hell?

2012-03-14 Thread knavero
Here's the exact error I'm receiving: http://pastebin.com/mNsPauwk Tracked each output along the way. Starting to think there's a bug in the source code. -- View this message in context:

[R] Reading and analyzing data with two headers

2012-03-14 Thread jorge Rogrigues
I have data that I would like to analyze in R with the following format: *,M1,,M2, *,S1,S2,S1,S2, p1,m1s1v1,m1s2v1,m2s1v1,m2s2v1 p2,m1s1v2,m1s2v2,m2s1v2,m2s2v2 ..,...,...,..., so I have a method M1 and M2 and each of these have attributes that I would like to analyze for the different

[R] climate data, Netcdf

2012-03-14 Thread Amen
As you can see: time is from 1 to 1460, 1 means they the measure Tem for the globe at the first 6 hours , 2=after 12 hours .; and so on 1460 *6 = 8760 hours which equals 1 year first of all I want to convert all data from kelvin to degree second I want to convert from 6 hourly to daily

Re: [R] How to test the statistical significance of the difference of two univariate Linear Regression betas?

2012-03-14 Thread peter dalgaard
On Mar 14, 2012, at 16:21 , Michael wrote: How to test the statistical significance of the difference of two univariate Linear Regression betas? Hi all, There are two samples of data: D1 and D2. On data D1 we do a univariate Linear Regression and get the coefficient beta1. On data

Re: [R] How to test the statistical significance of the difference of two univariate Linear Regression betas?

2012-03-14 Thread Bert Gunter
1. Is this homework? -- we don't do homework. 2. This is not an R question -- posting to stats.stackexchange.com or other statistics websites is usually more appropriate for such non-R statistical questions 3. General approach: Combine all data; model it with both a simpler (fewer parameter,

Re: [R] How to test the statistical significance of the difference of two univariate Linear Regression betas?

2012-03-14 Thread Michael
Thank you! How large is large sample? What about 50 data points in D1 and another 50 data points in D2? Thanks a lot! On Wed, Mar 14, 2012 at 11:49 AM, peter dalgaard pda...@gmail.com wrote: On Mar 14, 2012, at 16:21 , Michael wrote: How to test the statistical significance of the

Re: [R] How to use ggplot to do the binned quantile plots(one type of scatter plot)?

2012-03-14 Thread Michael
How to stack these subplots horizontally and vertically together in a nice way? Thank you! On Wed, Mar 14, 2012 at 11:04 AM, Clint Bowman cl...@ecy.wa.gov wrote: ?quantile on the individual bins, make your deciles, then plot the ten series as usual with your x values at the midpoint of the

[R] statistical contrasts on 3-way interaction

2012-03-14 Thread array chip
Hi all,  I was trying to use glht() from multcomp package to construct a contrast on interaction term in a linear model to do some comparisons. I am little uncertain on how to construct contrasts on a 3-way interaction containing a continuous variable, and hope someone can confirm what I did

Re: [R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Ben quant
That was embarrassingly easy. Thanks again Patrick! Just correcting a little typo to his reply. this is probably what he meant: pred = predict(fit,data.frame(x=xx),type=response,se.fit=TRUE) upper = pred$fit + 1.96 * pred$se.fit lower = pred$fit - 1.96 * pred$se.fit # For people who are

Re: [R] gam - Y axis probability scale with confidence/error lines

2012-03-14 Thread Patrick Breheny
Actually, I responded a bit too quickly last time, without really reading through your example carefully. You're fitting a logistic regression model and plotting the results on the probability scale. The better way to do what you propose is to obtain the confidence interval on the scale of

Re: [R] sort list

2012-03-14 Thread R. Michael Weylandt
What sort of plot are you using? I'm not really clear on what your data as a whole look like: if you use dput() you can create a representation and we can work from there. In addition to the resources Josh recommended, the following sites can direct you to all sorts of graphical goodies, all of

Re: [R] Merging fully overlapping groups

2012-03-14 Thread Jean V Adams
This code performs the same operation in about 1/10th the time on my machine. Give it a try. look - function(i) { # look for subsets dif - m[, i] - m apply(dif, 2, min) -0.5 } nosubsets - function(df) { # eliminate events that are subsets of other events

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-14 Thread R. Michael Weylandt
My apologies: I was thinking of rolling more in the sense of sliding than creeping. I'm not aware of anything suited for that, but it's not hard to roll your own with something like dats - data.frame(x = 1:100, y = rnorm(100)) for(i in 80:100){ lm(y ~ x, data = dats[1:i, ]) } Michael On

  1   2   >