[R] power spectrum of eeg

2010-11-21 Thread Az Ha
Hi, I need to find the power spectrum of an eeg and display frequency in hz. I found two functions, spectrum or auspec but they give me frequency from 0.0 - 0.5. How do i get frequency in Hz or KHz? Also, is it possible to plot two overlapping spectra in order to compare their peaks etc? Thanks

Re: [R] calculating martingale residual on new data using predict.coxph

2010-11-21 Thread Shi, Tao
Hi David, Thanks, but I don't quite follow your examples below. The residuals you calculated are still based on the training data from which your cox model was generated. I'm interested in the testing data. Best, ...Tao - Original Message From: David Winsemius

Re: [R] how to apply sample function to each row of a data frame?

2010-11-21 Thread wangwallace
it works. I really appreciate the help! :) -- View this message in context: http://r.789695.n4.nabble.com/Re-how-to-apply-sample-function-to-each-row-of-a-data-frame-tp3050933p3052098.html Sent from the R help mailing list archive at Nabble.com. __

[R] use sample function to create new data frame

2010-11-21 Thread wangwallace
here is my original data frame a b c A B C [1,] 1 2 3 4 5 6 [2,] 7 8 9 10 11 12 [3,] 13 14 15 16 17 18 a, b, c are type I variables A, B, C are type II variables how can I create a new data frame in which: 1) in each row, there are one random number from type I

[R] How to calculate squared R of spatial autoregressive models

2010-11-21 Thread elaine kuo
Dear List, I am comparing the squared R values of linear models and its spatial autoregressive counterparts. (SARerror) (1. lm (Y~X1) 2. lm (Y~ X1+X2) 3. lm(Y~X1+X2+X3)) The squared R values of linear models are generated by command summary (lm). Similarly, I tried to produce those of

Re: [R] How to produce glm graph

2010-11-21 Thread Rubén Roa
In addition to David's suggestion, you might want to examine the termplot function, ?termplot HTH -Original Message- From: r-help-boun...@r-project.org on behalf of David Winsemius Sent: Sat 11/20/2010 3:54 PM To: Sonja Klein Cc: r-help@r-project.org Subject: Re: [R] How to produce glm

Re: [R] Problem on running update

2010-11-21 Thread Stephen Liu
Hi Martin, Thanks for your advice. Ran following code on R-2.12.0 32bit as admin for(lib in .libPaths()) { + descs - Sys.glob(file.path(lib, *, DESCRIPTION)) + sizes - file.info(descs)$size + names(sizes) - descs + print(sizes[sizes 100]) + } named numeric(0) named numeric(0) Where are the

Re: [R] Counting things in a time series.

2010-11-21 Thread jim holtman
You never did show us what your data looks like. You could convert them to POSIXct, then use 'cut' to split them into the bins and then 'table' to count them. Try something like this: timeStamp - as.POSIXct('2010-11-21 00:00') + runif(50, 0, 86400) # day's worth of time # bin into 1 hour

[R] [beginner] how to run *.r script from graphic interface (R Console window) ?

2010-11-21 Thread madr
Is there a fuction like open(path/to/file), readfile or sth like that that would run code from R file just like I was it typing myself into R Console window ? -- View this message in context:

Re: [R] [beginner] how to run *.r script from graphic interface (R Console window) ?

2010-11-21 Thread Dimitris Rizopoulos
Have a look at function source(), i.e., type in the R console ?source I hope it helps. Best, Dimitris On 11/21/2010 1:23 PM, madr wrote: Is there a fuction like open(path/to/file), readfile or sth like that that would run code from R file just like I was it typing myself into R Console

[R] display data as 1px dots in scatterplot ?

2010-11-21 Thread madr
By default scatter-plot presents data by using circles, is there a way to make it 1px dots ? -- View this message in context: http://r.789695.n4.nabble.com/display-data-as-1px-dots-in-scatterplot-tp3052343p3052343.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Counting things in a time series.

2010-11-21 Thread Daniel Malter
Hi, these are pretty basic questions. You might want to pick up an introductory manual. Lets assume you have a time stamp that already indicates the hours. Assume you have 300 observations, each of which falls in one of 24 hours of observation. You easily get the number of obs in each hour with

Re: [R] calculating martingale residual on new data using

2010-11-21 Thread Frank Harrell
The tendency is to use residual-like diagnostics on the entire dataset that was available for model development. For test data we typically run predictive accuracy analyses. For example, one of the strongest validations is to show, in a high-resolution calibration plot, that absolute

Re: [R] calculating martingale residual on new data using predict.coxph

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 3:42 AM, Shi, Tao wrote: Hi David, Thanks, but I don't quite follow your examples below. I wasn't really sure they did anything useful anyway. The residuals you calculated are still based on the training data from which your cox model was generated. I'm interested

Re: [R] display data as 1px dots in scatterplot ?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 7:46 AM, madr wrote: By default scatter-plot There is no R function by that name. presents data by using circles, is there a way to make it 1px dots ? It may depend on the actual plotting function, which you have not mentioned, but as a starter read up on the cex

[R] Alternatives to image(...) and filled.contour(...) for 2-D filled Plots

2010-11-21 Thread Jason Rupert
By any chance are there any alternatives to image(...) and filled.contour(...) I used Rseek to search for that very topic, but didn't turn over any leads...

Re: [R] display data as 1px dots in scatterplot ?

2010-11-21 Thread William Revelle
At 4:46 AM -0800 11/21/10, madr wrote: By default scatter-plot presents data by using circles, is there a way to make it 1px dots ? -- View this message in context: http://r.789695.n4.nabble.com/display-data-as-1px-dots-in-scatterplot-tp3052343p3052343.html Sent from the R help mailing list

[R] negative alpha or custom gradient colors of data dots in scatterplot ?

2010-11-21 Thread madr
I know that by setting alpha to for example col = rgb(0, 0, 0, 0.1) it is possible to see how many overlapping is in the plot. But disadvantage of it is that single points are barely visible on the background. So I wonder if there is possible to make setting that single points would be almost

[R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. -- View this message in context:

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 9:52 AM, madr wrote: I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. ?stop -- David Winsemius, MD West Hartford, CT

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I try to use stop(), but i get: Error in eval.with.vis(expr, envir, enclos) : -- View this message in context: http://r.789695.n4.nabble.com/beginner-simple-keyword-to-exit-script-tp3052417p3052430.html Sent from the R help mailing list archive at Nabble.com.

[R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread madr
Labels are still present on graph render, their names are x and y that is the same as I used on the variables to supply data for chart. How to get rid of them. -- View this message in context:

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
stop() throws an error but the side effect is to pop out of whatever environment you may be in and return to the top-level. I thought that was what you wanted. If not, then please produce a better problem description with code as requested in the posting guide. On Nov 21, 2010, at 10:12

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 10:21 AM, madr wrote: Labels are still present on graph render, their names are x and y that is the same as I used on the variables to supply data for chart. How to get rid of them. The term labels as used in functions is different than the graphical objects

[R] abline(h=whatever) not working in candleChart() (in quantmod)?

2010-11-21 Thread David L. Van Brunt, Ph.D.
Hello, all-- I am having some fun playing with the graphing in quantmod-- very nice! I am writing a function to calculate (and hopefully plot) support and resistance lines, but the usual plot call of abline(h=value) does not seem to work. Here's my code: require(quantmod) AAPL-getYahooData(AAPL)

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 10:43 AM, madr wrote: Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, If you are in a function, then return() like after user input, exiting then is not always identical with error ,

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread madr
here's the code x= c(1,5,7,3,4) y= c(2,4,5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5), xaxt=NULL,yaxt=NULL, xlab=NULL,ylab=NULL) and x and y are still visible -- View this message in context:

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread Luke Miller
Replace the xlab=NULL and ylab=NULL in your example code with xlab= and ylab= to remove the x and y labels on your axes. If you're also trying to remove the ticks and tick labels, substitute xaxt=n and yaxt=n into your code. x= c(1,5,7,3,4) y= c(2,4,5,2,5)

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 11:02 AM, madr wrote: here's the code x= c(1,5,7,3,4) y= c(2,4,5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5), xaxt=NULL,yaxt=NULL, xlab=NULL,ylab=NULL) and x and y are still visible ?par for valid xaxt and yaxt values. And

[R] resample from tail of exponential

2010-11-21 Thread solafah bh
Hello If i want to resample from the tail of exponential distribution,and the observations are divided to intervals ,the probability of each interval is p.what is the suitable command? Regards   Sulafah [[alternative HTML version deleted]]

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread Peter Ehlers
On 2010-11-21 08:02, madr wrote: here's the code x= c(1,5,7,3,4) y= c(2,4,5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5), xaxt=NULL,yaxt=NULL, xlab=NULL,ylab=NULL) and x and y are still visible If you just want to remove both axis titles (xlab and

Re: [R] RCurl and cookies in POST requests

2010-11-21 Thread Duncan Temple Lang
Hi Christian There is a new version of the RCurl package on the Omegahat repository and that handles this case. The issue was running the finalizer to garbage collect the curl handle, and it was correctly not being released as the dynCurlReader() update function was precious and had a reference

Re: [R] power spectrum of eeg

2010-11-21 Thread Mike Marchywka
Date: Sun, 21 Nov 2010 00:18:24 -0800 From: master.rs...@yahoo.com To: r-help@r-project.org Subject: [R] power spectrum of eeg Hi, I need to find the power spectrum of an eeg and display frequency in hz. I found two functions, spectrum or auspec but they give me frequency from 0.0 -

Re: [R] ?summaryRprof running at 100% cpu for one hour ...

2010-11-21 Thread Uwe Ligges
On 21.11.2010 01:30, Kjetil Halvorsen wrote: see below. 2010/11/20 Uwe Liggeslig...@statistik.tu-dortmund.de: On 19.11.2010 21:43, Kjetil Halvorsen wrote: This is very strange. (Debian squeeze, R 2.12.0 compiled from source) I did some moderately large computation (including svd of a

Re: [R] ?summaryRprof running at 100% cpu for one hour ...

2010-11-21 Thread Uwe Ligges
OK, trying it on a 8Gb Windows machine with R-2.12.0 64-bit it runs within less than 2 minutes in 5Gb of RAM. That means your machine is probably swapping heavily and is therefore extremely slow. Nevertheless, this seems to be unrelated with summaryRprof(). The anacor() call is roughly

[R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
x= c(1,5,7,-3,4) y= c(2,4,-5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5),yaxt=n, ann=FALSE) and this code produces: http://i53.tinypic.com/ffd7d3.png Where I marked in red areas that I want to get rid of and use as much real screen estate as I can. --

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, like after user input, exiting then is not always identical with error , there are cases when it is intended behavior. I thought R makes that distinction. -- View

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 11:49 AM, madr wrote: x= c(1,5,7,-3,4) y= c(2,4,-5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5),yaxt=n, ann=FALSE) Rather than filling up r-help with incremental beginner questions you need to either: --- read more

Re: [R] Merge two ggplots

2010-11-21 Thread Dennis Murphy
Hi: On Sun, Nov 21, 2010 at 5:55 AM, Alaios ala...@yahoo.com wrote: Sorry it was a typo: my code looks like: plot_shad_CR-function(x,y,agentid,CRagent,f){ library(ggplot2) plotdata-melt(f) names(plotdata)-c('x','y','z') agent-CRagent[[agentid]] # To make following expression

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Gabor Grothendieck
On Sun, Nov 21, 2010 at 9:52 AM, madr madra...@interia.pl wrote: I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. 1. use my.source() below instead of

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Henrik Bengtsson
Better is probably to return() from a function, i.e. define a function in your script and call that at the end of your function, e.g. - - - - main - function() { # bla # bla if (something) { return(); } # otherwise # bla } main(); - - - - Otherwise, here is a hack:

Re: [R] Problem on running update

2010-11-21 Thread Martin Morgan
On 11/21/2010 03:12 AM, Stephen Liu wrote: Hi Martin, Thanks for your advice. Ran following code on R-2.12.0 32bit as admin for(lib in .libPaths()) { + descs - Sys.glob(file.path(lib, *, DESCRIPTION)) + sizes - file.info(descs)$size + names(sizes) - descs + print(sizes[sizes 100])

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread John Kane
Alternatively give ggplot2 package a try: x= c(1,5,7,-3,4) y= c(2,4,-5,2,5) xx - data.frame(x,y) library(ggplot2) qplot(x,y, data=xx) --- On Sun, 11/21/10, madr madra...@interia.pl wrote: From: madr madra...@interia.pl Subject: [R] how to get rid of unused space on all 4 borders in

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread Petr Savicky
On Sun, Nov 21, 2010 at 10:56:14AM -0500, David Winsemius wrote: On Nov 21, 2010, at 10:43 AM, madr wrote: Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, If you are in a function, then return() like

[R] Merge two ggplots

2010-11-21 Thread Alaios
Sorry it was a typo: my code looks like: plot_shad_CR-function(x,y,agentid,CRagent,f){   library(ggplot2)      plotdata-melt(f)   names(plotdata)-c('x','y','z')   agent-CRagent[[agentid]] # To make following expression shorter   ggplot((data.frame(x=CRX,y=CRY,sr=agent$sr)))+  

Re: [R] a philosophy R question

2010-11-21 Thread Erin Hodgess
Thanks to all for the great insightful answers! Sincerely, Erin On Sat, Nov 20, 2010 at 10:22 PM, bill.venab...@csiro.au wrote: The conventional view used to be that S is the language and that R and S-PLUS are implementations of it.  R is usually described as 'a programming environment

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
I have looked into par documentation, and only setting for size of the plot area was pin. But this setting sets the area as inflexible, that is no matter how I make the window small or big it stays the same. Default value has advantage that however it uses plot area that is always smaller than

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Henrik Bengtsson Sent: Sunday, November 21, 2010 8:17 AM To: David Winsemius Cc: r-help; madr Subject: Re: [R] [beginner] simple keyword to exit script ? Better is probably

Re: [R] density at particular values

2010-11-21 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shant Ch Sent: Saturday, November 20, 2010 6:34 PM To: David Winsemius Cc: r-help@r-project.org Subject: Re: [R] density at particular values David, I did look at ?density

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 1:31 PM, madr wrote: I have looked into par documentation, and only setting for size of the plot area was pin. But this setting sets the area as inflexible, that is no matter how I make the window small or big it stays the same. Default value has advantage that

[R] boxplot: reverse y-axis order

2010-11-21 Thread emorway
Hello, Searching this forum has enabled me to get pretty far in what I'm trying to do. However, there is one more manipulation I would like to make and I haven't found a solution. Using the data and code below, I generate the plot produced by the last command. If possible I would like to

Re: [R] use sample function to create new data frame

2010-11-21 Thread wangwallace
Gong, thanks!! but your syntax did work out as I would expect. here following are the reasons: each row from my original data frame represents data from one subject. when the one type I number and the two type II numbers are drawn from the original data frame, both type I number and type II

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 2:43 PM, madr wrote: finally I found what I wanted, John Kane send it, and I don't know why it hasn't been posted automatically to the list so I post it by myself: solution is this: par(mai=c(.5,.5,.5,.5)) These four numbers are the margins, so setting it to 0,0,0,0

[R] model.matrix() and lm() for nested factors

2010-11-21 Thread Saul Sternberg
To R-help list: I would like to use lm() and lmRob() to estimate the parameters of a fixed-effects model that includes nested factors with unequal numbers of levels, in some cases without also including the nesting factor in the model. When I specify options(contrasts=c(contr.sum,contr.poly)),

Re: [R] how to draw manifold?

2010-11-21 Thread baptiste auguie
Hi, I'm joining in with a question -- is it possible to vary the color of the lines along z? The 'colors' argument doesn't seem to allow a vector in this situation. Thanks, baptiste On 21 November 2010 21:02, Carl Witthoft c...@witthoft.com wrote: Thanks, Dennis.   Here's an enhanced

[R] between-group covar matrix

2010-11-21 Thread jack hietpas
Hello- I am trying to calculate the between-group covariance matrix for a set of data for eventual Canonical Discrim Analysis. I can obtain the total covariance matrix and individual group covar matrix, but I am failing miserably at getting the between-group covar. The data set is composed of 9

Re: [R] how to draw manifold?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 3:42 PM, baptiste auguie wrote: Hi, I'm joining in with a question -- is it possible to vary the color of the lines along z? The 'colors' argument doesn't seem to allow a vector in this situation. This section of the code (which appears fairly close to the beginning,

Re: [R] abline(h=whatever) not working in candleChart() (in quantmod)?

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 10:50 AM, David L. Van Brunt, Ph.D. wrote: Hello, all-- I am having some fun playing with the graphing in quantmod-- very nice! I am writing a function to calculate (and hopefully plot) support and resistance lines, but the usual plot call of abline(h=value) does not

Re: [R] boxplot: reverse y-axis order

2010-11-21 Thread Uwe Ligges
On 21.11.2010 20:30, emorway wrote: Hello, Searching this forum has enabled me to get pretty far in what I'm trying to do. However, there is one more manipulation I would like to make and I haven't found a solution. Using the data and code below, I generate the plot produced by the last

Re: [R] how to draw manifold?

2010-11-21 Thread Carl Witthoft
Thanks, Dennis. Here's an enhanced version: z - seq(-10, 10, 0.1) zm-cbind(z,z,z,z,z,z,z,z,z,z) ym-matrix(nr=201,nc=10) for (i in seq(1,201)) { for (j in seq(1,10)) ym[i,j]-j/10*sin(zm[i,1])} xm-matrix(nr=201,nc=10) for (i in seq(1,201)) { for (j in seq(1,10))

Re: [R] density at particular values

2010-11-21 Thread Ted Harding
On 21-Nov-10 19:11:20, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Shant Ch Sent: Saturday, November 20, 2010 6:34 PM To: David Winsemius Cc: r-help@r-project.org Subject: Re: [R] density at

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
# 89 px / 105 px - wasted space png(d:/test.png,width=1369,height=1129,units=px) par(bg='black',fg='gray',col='gray',col.axis='gray',col.lab='gray',col.main='gray',col.sub='gray') plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='.',col = rgb(1,1,1, 0.5),yaxt=n, ann=FALSE) dev.off() so only

Re: [R] How to produce glm graph

2010-11-21 Thread Michael Friendly
As others have noted, you can use predict() to get the fitted values and then plot them 'manually' using basic plotting functions in R. However, you will probably find it easier to use the effects package, which is designed for exactly this task. e.g., install.packages(effects) # if necessary

[R] is it possible to put tick labels inside plotting area ?

2010-11-21 Thread madr
here is what i mean: before: http://i51.tinypic.com/117xv6v.png after : http://i51.tinypic.com/sv2xed.png -- View this message in context: http://r.789695.n4.nabble.com/is-it-possible-to-put-tick-labels-inside-plotting-area-tp3052777p3052777.html Sent from the R help mailing list archive at

Re: [R] stupid R tricks

2010-11-21 Thread Carlos J. Gil Bellosta
On 11/07/2010 08:06 PM, David Winsemius wrote: On Nov 7, 2010, at 12:25 PM, David Winsemius wrote: On Nov 7, 2010, at 11:40 AM, Carl Witthoft wrote: Hi all, Just thought I'd post this (maybe) helpful tool I wrote. For people like me who are bad at keeping a clean environment, it's a

Re: [R] is it possible to put tick labels inside plotting area ?

2010-11-21 Thread madr
I found it. It was hard to find because no one asked about it , the proper question was about distance from the axis which can be negative. So the proper answer is : par( mgp = c(0, -1.4, 0) ) - only the center value is controlling feature in question. -- View this message in context:

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
finally I found what I wanted, John Kane send it, and I don't know why it hasn't been posted automatically to the list so I post it by myself: solution is this: par(mai=c(.5,.5,.5,.5)) These four numbers are the margins, so setting it to 0,0,0,0 will render only plot area with 1px for box on

Re: [R] is it possible to put tick labels inside plotting area ?

2010-11-21 Thread Peter Ehlers
On 2010-11-21 13:18, madr wrote: I found it. It was hard to find because no one asked about it , the proper question was about distance from the axis which can be negative. So the proper answer is : par( mgp = c(0, -1.4, 0) ) - only the center value is controlling feature in question. If

[R] Fwd: Fwd: R help

2010-11-21 Thread Ahmed Attia
On 11/21/10 11:24, Ahmed Attia wrote: -- Forwarded message -- From: Ahmed Attia ahmedati...@gmail.com Date: Sun, Nov 21, 2010 at 11:06 AM Subject: R help To: r-help@r-project.org Dear All, I'm a beginner user in R and I would like to make a quadratic plus plateau and

Re: [R] Fwd: Fwd: R help

2010-11-21 Thread Joshua Wiley
Dear Ahmed, Can you give a more specific example of what you want to do? Do you mean you want to test specific contrasts for a categorical variable? If you are new to R, you will find it helpful to read the Introduction to R http://cran.r-project.org/doc/manuals/R-intro.html I also recommend

Re: [R] Problem on running update

2010-11-21 Thread Stephen Liu
Hi Martin, Thanks for your advice. This is my first time hunting for cause of error on R. Steps performed as follows; Sys.glob(file.path(.libPaths()[1], *, DESCRIPTION)) [1] C:\\Users\\satimis\\Documents/R/win-library/2.12/Ecdat/DESCRIPTION [2]

Re: [R] Fwd: Fwd: R help

2010-11-21 Thread Mike Marchywka
Date: Sun, 21 Nov 2010 16:01:44 -0800 From: jwiley.ps...@gmail.com To: ahmedati...@gmail.com CC: r-help@r-project.org Subject: Re: [R] Fwd: Fwd: R help Dear Ahmed, Can you give a more specific example of what you want to do? Do you mean you

[R] Making a line in a legend shorter

2010-11-21 Thread Luis Felipe Parra
Hello, I am putting a legend with lines in a line plot and I would like to make the lines in the legend shorter. Does anybody knows how to do this? Thank you Felipe Parra [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Help with linear plus plateau fit model

2010-11-21 Thread Ahmed Attia
Dear R users, If you could please provide an example with the data set for the linear plus plateau model in R. I've 5 N rates and I need to make this model between N rates and grain Yield. Thanks so much Ahmed -- Ahmed M. Attia Assistant Lecturer El-Khattara farm Station Agronomy Dept.,

Re: [R] Problem on running update

2010-11-21 Thread Martin Morgan
On 11/21/2010 05:21 PM, Stephen Liu wrote: Hi Martin, Thanks for your advice. This is my first time hunting for cause of error on R. Hi Stephen -- read the help pages ?browser, ?recover *before* trying to use the commands ... ?browser ?recover Steps performed as follows;

[R] R help

2010-11-21 Thread Ahmed Attia
Dear All, I'm a beginner user in R and I would like to make a quadratic and plateau model in R. Can you help please with an example? Thanks so much -- Ahmed M. Attia Assistant Lecturer El-Khattara farm Station Agronomy Dept., Zgazig Univ., Egypt Visiting Scientist Haskell Agricultural

Re: [R] how to apply sample function to each row of a data frame?

2010-11-21 Thread wangwallace
Hey, PS, I revised your syntax and used it to another one of my data frames (df). here is the data frame: a b c A B C [1,] 1 2 3 4 5 6 [2,] 7 8 9 10 11 12 [3,] 13 14 15 16 17 18 a, b, c are type I variables A, B, C are type II variables each row represent the

[R] Lost in POSIX

2010-11-21 Thread Dimitri Shvorob
Can someone please fix this snippet? (i.e. append to the dataframe a column containing truncated time value)? df = structure(list(t = structure(c(1033963406.044, 1033974144.847, 1033988418.836), class = c(POSIXt, POSIXct))), .Names = t, row.names = c(NA, 3L), class = data.frame) # Try 1

Re: [R] power spectrum of eeg

2010-11-21 Thread David Scott
On 21/11/10 21:18, Az Ha wrote: Hi, I need to find the power spectrum of an eeg and display frequency in hz. I found two functions, spectrum or auspec but they give me frequency from 0.0 - 0.5. How do i get frequency in Hz or KHz? Also, is it possible to plot two overlapping spectra in order to

Re: [R] Lost in POSIX

2010-11-21 Thread David Winsemius
On Nov 21, 2010, at 3:52 PM, Dimitri Shvorob wrote: Can someone please fix this snippet? (i.e. append to the dataframe a column containing truncated time value)? df = structure(list(t = structure(c(1033963406.044, 1033974144.847, 1033988418.836), class = c(POSIXt, POSIXct))), .Names = t,

[R] need smooth cdf lines

2010-11-21 Thread Roslina Zakaria
Hi, I would like to overlap the cdf curve for observed and generated data  Here is my code: plot(cdf,main =CDF of the sum for winter season-Hume,cex.axis=1.2,xlab=Rainfall (mm), xaxs=i,yaxs=i,col=c(black,red), lty=c(1,1),ylab=Cumulative probability, xlim=c(0,800),lwd=1) lines(ecdf(datobs))

Re: [R] need smooth cdf lines

2010-11-21 Thread Michael Bedward
Ah, this looks like Australian data :) One simple way would be to use the lowess function and fiddle with the f parameter (like bandwidth). Michael On 22 November 2010 14:18, Roslina Zakaria zrosl...@yahoo.com wrote: Hi, I would like to overlap the cdf curve for observed and generated data 

Re: [R] R help

2010-11-21 Thread Michael Bedward
Hi Ahmed, Does 'quadratic plateau' model refer to a chage-point or bent-cable regression with quadratic on one side and an asymptote on the other ? If so, you might like to look at the bentcableAR package. There is a background article here:

Re: [R] R help

2010-11-21 Thread Michael Bedward
Sorry, chage-point should be change-point On 22 November 2010 14:44, Michael Bedward michael.bedw...@gmail.com wrote: Hi Ahmed, Does 'quadratic plateau' model refer to a chage-point or bent-cable regression with quadratic on one side and an asymptote on the other ? If so, you might like to

Re: [R] Problem on running update

2010-11-21 Thread Stephen Liu
Hi Martin, Sorry I can't fix the update problem. Reading ?browser and ?recover didn't help me out. Finally I uninstalled R, 32/64 bit and RExcel and made a fresh installation of them. Remark: I need to remove all folders with connection to them. Otherwise after installing R, RExcel,

[R] Problems using Internal filledcontour: dimension mismatch

2010-11-21 Thread Jason Rupert
In order to gain a bit more control over the fill contour functionality I'm trying to use the Internal filledcontour function. I wasn't able any documentation on this function and only one reference to it. I believe the code shown below is close because all the dimensions seem to be

Re: [R] plot vs print ??

2010-11-21 Thread Deepayan Sarkar
2010/11/20 Uwe Ligges lig...@statistik.tu-dortmund.de: On 18.11.2010 11:30, skan wrote: Hello everybody. My question arised from the output of lattice's histogram. But might be extended to any other object that could be printed. I think I've understood your answers,  print calls the plot

Re: [R] R help

2010-11-21 Thread Michael Bedward
Hi Ahmed, Please reply via the list - you'll get better answers because most people there know more than me :) Here is a toy example that is similar to the example graph you sent me... # generate data: linear up to a change point, then plateau with constant std dev x - 20:70 y -

[R] Splitting 3D matrix from for loop to generate/save 2D matrices

2010-11-21 Thread Hana Lee
Hi! I have a matrix called M with dimension (586,100,100). I would like to split and save this into 586 matrices with dimension 100 by 100. I have tried the following for loops but couldn't get it work.. l-dim(M)[1] for (i in (1:l)){ save(M[i,,],file = M_[i].img) } Can somebody help me with

Re: [R] Splitting 3D matrix from for loop to generate/save 2D matrices

2010-11-21 Thread Henrik Bengtsson
Hi, On Sun, Nov 21, 2010 at 9:27 PM, Hana Lee hana...@email.unc.edu wrote: Hi! I have a matrix called M with dimension (586,100,100). First of all, In R it is only an object with *two* dimensions that is called matrix. Anything with two or more dimensions is called an array. Example: x -

Re: [R] Splitting 3D matrix from for loop to generate/save 2D matrices

2010-11-21 Thread Michael Bedward
Hi Hana, Use the paste function to create your file names. for ( i in 1:dim(M)[1] ) save( M[i,,], file=paste(M_, i, .img, sep=) ) Alternatively, use the sprintf function to get names with leading zeroes for easier sorting of files: for (i in 1:dim(M)[1] ) save( M[i,,], file=sprintf(M_%03d.img,

Re: [R] Splitting 3D matrix from for loop to generate/save 2D matrices

2010-11-21 Thread Henrik Bengtsson
Sorry, I did a mistake corrected below. On Sun, Nov 21, 2010 at 9:50 PM, hb h...@biostat.ucsf.edu wrote: Hi, On Sun, Nov 21, 2010 at 9:27 PM, Hana Lee hana...@email.unc.edu wrote: Hi! I have a matrix called M with dimension (586,100,100). First of all, In R it is only an object with *two*

Re: [R] power spectrum of eeg

2010-11-21 Thread Az Ha
David Scott-6 wrote: On 21/11/10 21:18, Az Ha wrote: Hi, I need to find the power spectrum of an eeg and display frequency in hz. I found two functions, spectrum or auspec but they give me frequency from 0.0 - 0.5. How do i get frequency in Hz or KHz? Also, is it possible to plot two

Re: [R] Splitting 3D matrix from for loop to generate/save 2D matrices

2010-11-21 Thread David Winsemius
On Nov 22, 2010, at 12:27 AM, Hana Lee wrote: Hi! I have a matrix called M with dimension (586,100,100). In R you have an array (not a matrix) wehn the number of dimensions is 3. I would like to split and save this into 586 matrices with dimension 100 by 100. I have tried the

[R] plot start at origin

2010-11-21 Thread Roslina Zakaria
Hi r-users, I would like my axes to intersect at (0,0).  I tried  xaxs=i,yaxs=i but it does not change anything.  I hope anybody can help me with this problem.  Here is my code. hist(datobs, prob=TRUE, main =PDF of the sum of two stations,col=yellowgreen, cex.axis=1.2, xlab=Rainfall (mm),

[R] How to combine Date and time in one column

2010-11-21 Thread rnick
Hello everyone, I am trying to built an xts object and i have run into some problems on the data handling. I would really appreciate if someone could help me with the following: 1) I have a OHLC dataset with Time and date in different columns. How could i combine date and time in one column in

Re: [R] Rlanguage plr and loadiing climatol package

2010-11-21 Thread David Potts
Thank to everybody that helped. I have a working bit of code :-) On Nov 20, 2010, at 3:25 PM, David Potts wrote: Hi List I am trying to call the R library function rosavent from the climatol package via the plr interface package to the postgres database. My code is a follows create