Re: [R] Basic question about re-writing for loop as a function

2011-08-29 Thread Patrick Burns
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter

Re: [R] fill Matrix quicker

2011-08-01 Thread Patrick Burns
-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing

Re: [R] Why is looping in R inefficient, but in C not?

2011-06-26 Thread Patrick Burns
-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing

Re: [R] Documentation

2011-06-21 Thread Patrick Burns
? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu

Re: [R] Simple R Question...

2011-05-21 Thread Patrick Burns
. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu

[R] The R Inferno revised

2011-05-02 Thread Patrick Burns
Hell is new and improved. The new version is in the same old place: http://www.burns-stat.com/pages/Tutor/R_inferno.pdf An explanation of the changes is at: http://www.portfolioprobe.com/2011/05/02/the-r-inferno-revised/ -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http

Re: [R] Correlation for no of variables

2011-03-21 Thread Patrick Burns
]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter

Re: [R] Variable names AS variable names?

2011-02-25 Thread Patrick Burns
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints

[R] review of R Graphs Cookbook

2011-01-25 Thread Patrick Burns
If you are foolish enough not to be following R Bloggers via RSS or twitter, you might miss: http://www.portfolioprobe.com/2011/01/24/review-of-r-graphs-cookbook-by-hrishi-mittal/ Executive summary: Extremely useful for new users, informative to even quite seasoned users. -- Patrick Burns pbu

Re: [R] Finding NAs in DF

2011-01-17 Thread Patrick Burns
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] Calculating Portfolio Standard deviation

2011-01-10 Thread Patrick Burns
/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some

Re: [R] Calcuting returns

2011-01-06 Thread Patrick Burns
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu

Re: [R] What is the best way to lag a time series?

2010-12-26 Thread Patrick Burns
mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http

Re: [R] R-way to doing this?

2010-12-23 Thread Patrick Burns
-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] how to control ticks

2010-12-21 Thread Patrick Burns
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] 2D Random walk

2010-12-02 Thread Patrick Burns
=green4,xlim=range(xmin:xmax),ylim=range(ymin:ymax)) end-cbind(rw[1,1],rw[1,2]) start-cbind(0,0) points(start,pch=4,col=red) points(end,pch=4,col=red) -- Patrick Burns pbu...@pburns.seanet.com http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R

Re: [R] Array help

2010-11-29 Thread Patrick Burns
from 1:6 12:22 for 8am and then 7:11 23:34 for 9am. I was able easily make two arrays based on sex by just putting in StatTemps[1:11,,] StatTemps[12:34,,] and assumed I could just go StatTemps[1:612:22,,] and StatTemps[7:1123:34,,] but that didn't work. Any ideas? Thanks so much! -B -- Patrick

Re: [R] Feedback on you manual

2010-10-24 Thread Patrick Burns
remember the exact position of scroll. best Liping Liu On Sat, Oct 23, 2010 at 4:28 AM, Patrick Burns pbu...@pburns.seanet.com mailto:pbu...@pburns.seanet.com wrote: No (and I have an excuse). It is a tree of pages rather than a single document. My impression is that a pdf needs

Re: [R] Feedback on you manual

2010-10-24 Thread Patrick Burns
the eyes of a complete novice, it is really, really scary. If they were to think this was the only way to learn R, many will give up well before the night gets under way. [ ... ] Hope that helps, -steve -- Patrick Burns pbu...@pburns.seanet.com http://www.portfolioprobe.com/blog http://www.burns

Re: [R] Feedback on you manual

2010-10-23 Thread Patrick Burns
, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Feedback on you manual

2010-10-23 Thread Patrick Burns
No (and I have an excuse). It is a tree of pages rather than a single document. My impression is that a pdf needs to be linear. On 23/10/2010 10:09, Liviu Andronic wrote: (off-topic) Dear Patrick On Sat, Oct 23, 2010 at 10:57 AM, Patrick Burns pbu...@pburns.seanet.com wrote: Perhaps 'Some

[R] Ideas for World Statistics Day

2010-10-19 Thread Patrick Burns
are certainly welcome. -- Patrick Burns pbu...@pburns.seanet.com http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] head.matrix() unintelligent

2010-10-19 Thread Patrick Burns
and rowwise heads of a matrix? cheers, Bruce -- Patrick Burns pbu...@pburns.seanet.com http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https

Re: [R] efficient list indexing

2010-09-22 Thread Patrick Burns
and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Matrixes inside matrixes

2010-09-08 Thread Patrick Burns
, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] representing NULL values in a vector

2010-09-06 Thread Patrick Burns
-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] strange behavior of ifelse with factors

2010-08-21 Thread Patrick Burns
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Patrick Burns
@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home

Re: [R] T and F (was: Optimization problem with nonlinear constraint)

2010-07-28 Thread Patrick Burns
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] Question from day2 beginner

2010-07-19 Thread Patrick Burns
partialacf 43 -none- numeric resid20731 -none- numeric method 1 -none- character series 1 -none- character frequency1 -none- numeric call 3 -none- call asy.var.coef 1600 -none- numeric resid(ar(logrvar, aic=TRUE)) NULL -- Patrick Burns

Re: [R] Creating functions of many arguments

2010-07-16 Thread Patrick Burns
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r

Re: [R] logical to numeric matrix changing dimensions

2010-07-14 Thread Patrick Burns
://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner

Re: [R] F# vs. R

2010-07-08 Thread Patrick Burns
() or lme()/lmer() functions to test the timing, feel free... :-) So unless there is a pre-existing library of statistical and related functionality for F#, perhaps you need to reconsider your query. Regards, Marc Schwartz -- Patrick Burns pbu...@pburns.seanet.com http://www.burns

Re: [R] How to quick check two rows are the same?

2010-07-08 Thread Patrick Burns
/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] Assign Formulas to Arrays or Matrices?

2010-07-06 Thread Patrick Burns
Inferno'. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Using if statement on function

2010-06-28 Thread Patrick Burns
, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-22 Thread Patrick Burns
of statistics is actually done in Excel. Is Excel a statistics program? I don't think many people think that -- neither statisticians nor non-statisticians. Pat On 21/06/2010 10:32, Joris Meys wrote: On Mon, Jun 21, 2010 at 11:15 AM, Patrick Burns pbu...@pburns.seanet.com wrote: (Statistics

Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-21 Thread Patrick Burns
. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu

Re: [R] questions on some operators in R

2010-06-19 Thread Patrick Burns
-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] how to use sapply code

2010-06-17 Thread Patrick Burns
. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] How we can open the results are saved

2010-06-14 Thread Patrick Burns
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http

Re: [R] Row binding

2010-06-10 Thread Patrick Burns
time for row binding # need the alternate if u can help. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r

Re: [R] Computing day-over-day log return for a matrix containing multiple time series

2010-06-07 Thread Patrick Burns
commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Data Frame as Hash Table

2010-05-30 Thread Patrick Burns
mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R

Re: [R] subsetting

2010-05-30 Thread Patrick Burns
an empty data frame. For example I would like to extract all rows that have time == 0h and strain == ROC. So, t- subset(r, (r$time == 0h r$strain == ROC), select= c(time, strain, gene, deltact)) returns an empty data-frame. Is it not possible to subset based on two criteria? TIA Anjan -- Patrick

Re: [R] Fw: Improving loop performance

2010-05-11 Thread Patrick Burns
, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] scope of a function + lazy evaluation

2010-05-10 Thread Patrick Burns
://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r

Re: [R] help with tapply or other apply

2010-05-02 Thread Patrick Burns
, and this way is soo slowly. Know someone how to do it using function TAPPLY ? or another apply function ??? -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r

Re: [R] Confusing concept of vector and matrix in R

2010-04-27 Thread Patrick Burns
and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https

Re: [R] long output in R

2010-04-22 Thread Patrick Burns
code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Question about R mode

2010-04-15 Thread Patrick Burns
]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http

Re: [R] minimization function

2010-04-11 Thread Patrick Burns
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] match function or ==

2010-04-07 Thread Patrick Burns
that is more efficient, match or ==? For example, use-dataset[!is.na(match(dataset$companyID, 12345)),] or use-dataset[dataset$companyID==12345,] Thank you very much. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] R loop help

2010-03-27 Thread Patrick Burns
test_pic.jpg Thanks. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] select n rows

2010-03-27 Thread Patrick Burns
I'm thinking: mymatrix[1:8, ] On 27/03/2010 06:20, leobon wrote: Hello everyone, I have a matrix with 8000 rows. If I want to select every 8 rows, (i.e. row1, row2, ..., row8), what should I do? Appriciate for any hints! Thanks a lot! Leo -- Patrick Burns pbu...@pburns.seanet.com http

Re: [R] Odd results with %% and conserving memory

2010-03-27 Thread Patrick Burns
something like newmat = as.integer(mat*100) dim(newmat) = dim(mat) rm(mat) Is there a better way to convert my double matrix to an integer matrix without losing precision? Or are there better ways to conserve memory? I'm at the limit. Thanks, Justin -- Patrick Burns pbu...@pburns.seanet.com http

Re: [R] Help on getting help from manuals

2010-03-12 Thread Patrick Burns
. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] Some hints for the R beginner

2010-03-07 Thread Patrick Burns
always resonated with me. I offer you an imperfect, incomplete tree (but my roof is intact). Suggestions for improvements are encouraged. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno

Re: [R] two questions for R beginners

2010-03-03 Thread Patrick Burns
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list https

Re: [R] two questions for R beginners

2010-03-01 Thread Patrick Burns
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User

Re: [R] two questions for R beginners

2010-02-26 Thread Patrick Burns
? An Introduction to R by Venables simpleR – Using R for Introductory Statistics by Verzani -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org

Re: [R] two questions for R beginners

2010-02-26 Thread Patrick Burns
. [...] -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] two questions for R beginners

2010-02-25 Thread Patrick Burns
Apparently I need to explain the lazy and impatient comment. No offence was intended (quite the contrary). The meaning of it is that the higher your level of frustration, the more valuable your comments are likely to be to me. On 25/02/2010 17:31, Patrick Burns wrote: * What were your biggest

[R] two questions for R beginners

2010-02-25 Thread Patrick Burns
are just confirming what has been said on-list. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Multiple missing values

2010-02-14 Thread Patrick Burns
/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S

Re: [R] Random number quality

2010-02-06 Thread Patrick Burns
commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] pickle in R

2010-02-04 Thread Patrick Burns
, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Weighted SD

2010-02-02 Thread Patrick Burns
/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r-project.org mailing list

Re: [R] fatal error unable to restore saved data in .rdata

2010-01-23 Thread Patrick Burns
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Patrick Burns pbu...@pburns.seanet.com http://www.burns-stat.com (home of 'The R Inferno' and 'A Guide for the Unwilling S User') __ R-help@r

Re: [R] Choose every second value

2010-01-17 Thread Patrick Burns
Instead of making two vectors, you might want to just have one matrix with two rows: amat - matrix(a, nrow=2) Then you can do: amat[1,] amat[2,] Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User

Re: [R] forecasting

2009-12-18 Thread Patrick Burns
DispersionMap wrote: What about validating forecasting results. I have 5 years of data and have been forecasting the following three years i.e. 2010 to 2012. How can i check my forecast. Why types of tests are out there that can be implemented in R?? isbn 9780553213515 Sorry, couldn't

Re: [R] fortune, was: SAS datalines or cards statement equivalent in R?

2009-12-08 Thread Patrick Burns
Rolf Turner wrote: ... To paraphrase Eric Blair: ``SAS-thinkers unbellyfeel R-speak.'' cheers, Rolf Turner This *has* to be a fortune. Pat ## Attention:\ This e-mail message is privileged and

Re: [R] python

2009-11-21 Thread Patrick Burns
One little thing that I think Barry meant to say. If the bottleneck is in your code, you may be able to improve the situation enough by merely rewriting the R code of your function. If that doesn't work, then you can move to C. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread Patrick Burns
'The R Inferno' page 59. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) mau...@alice.it wrote: I can define a list containing NULL elements: myList - list(aaa,NULL,TRUE) names(myList) - c(first

Re: [R] negative length vectors are not allowed in wilcox.exact() and perm.test()

2009-10-16 Thread Patrick Burns
Ben Bolker wrote: David Croll wrote: I want to compare two datasets and I get the message Error in .Call(cpermdist2, ma = as.integer(m), mb = as.integer(col), : negative length vectors are not allowed after specifying the exact test. I'm using the exactRankTests package. Do you suggest

Re: [R] r-inferno.pdf with detailed table of contents and bookmarks

2009-09-17 Thread Patrick Burns
That's a reasonable request that I have planned for whenever I revise it. However, I'm not going to be doing that for some time yet (unit of time is somewhere in the months to years range). If someone is keen to do that, I can make the LyX file available to them. Patrick Burns patr...@burns

Re: [R] choosing of CPU's to run R

2009-08-27 Thread Patrick Burns
My guess is that there is not a simple answer. My newest machines are extremely fast at doing: sum(rnorm(1e6)) relative to my older machines. But they are not so much faster at doing the work that I actually want done. But if there is a simple answer, I'd be keen to hear it. Patrick Burns

Re: [R] Is there a summary on different version of 'apply' functions? What is the meaning of the prefixes?

2009-08-12 Thread Patrick Burns
Hadley's answer is probably better, but 'The R Inferno' page 15 is an answer to the literal question. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) hadley wickham wrote: You might also want

Re: [R] dienice for R

2009-08-08 Thread Patrick Burns
dienice - function() q(no) I think there is some fraction of the population that would think the above function would be 'dieNOTnice' and would have: dienice - function() q(yes) Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide

Re: [R] how import Excel data into R?

2009-08-05 Thread Patrick Burns
, but in addition translating it into English would have been a plus. A translation would be: Impossible to open the connection Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Inchallah Yarab wrote: Hi I want

Re: [R] sum of list elements

2009-07-03 Thread Patrick Burns
My guess is that the original poster is expecting a matrix not a scalar. If so, then: Reduce('+', a) [,1] [,2] [,3] [1,]300 [2,]030 [3,]003 Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno

Re: [R] How to avoid ifelse statement converting factor to character

2009-06-25 Thread Patrick Burns
This sort of experience is why 'The R Inferno' came into existence. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Craig P. Pyrame wrote: Dear Stavros, What you discuss below is somewhat scary

Re: [R] rbind

2009-06-22 Thread Patrick Burns
just as well. What are you planning on doing with a one-column matrix? Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Xiaogang Yang wrote: Hi, I have a array like this data: 1 5 2 2342 3 33

Re: [R] rbind

2009-06-22 Thread Patrick Burns
Now that I've actually read the question, I'm in a better position to answer it. I have no idea how you are getting the results that you show, but you can use 'rownames' to set whatever row names you like. As in: rownames(result) - 1:6 Pat Patrick Burns wrote: I'm guessing that your 'data

[R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns
for two reasons: 1) I wasn't sure what the preferred details are. 2) I realized that if people actually followed the suggestion and sent messages about documentation, R-core would be overwhelmed and not especially happy. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns

Re: [R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns
I neglected to say that I don't have the time to be one of the drivers for the proposed list. Pat Patrick Burns wrote: Proposal That a new mailing list be established that pertains exclusively to R documentation. The purpose of the list would be to discuss weak sections of the documentation

Re: [R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns
of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM Patrick Burns pbu...@pburns.seanet.com wrote

Re: [R] Error:non-numeric argument in my function

2009-06-01 Thread Patrick Burns
I thought Stavros' suggestion was going to be to have the error message say what type of offending object was found. If the message said that a list of class 'data.frame' was found (probably the leading case), then that would be much more helpful. Patrick Burns patr...@burns-stat.com +44 (0)20

Re: [R] R's documentation

2009-05-30 Thread Patrick Burns
Zeljko Vrba wrote: On Fri, May 29, 2009 at 05:20:24PM +0100, Patrick Burns wrote: If you find some documentation that is confusing, then you can write a message about it that states: I think that some kind of a glossary would be helpful. Then I would know whether certain words or phrases

Re: [R] R's documentation

2009-05-29 Thread Patrick Burns
, not just to the person who wrote the function), and they need to be short enough that people might read them. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Xin Zheng [[alternative HTML version deleted

Re: [R] How do you save in R?

2009-05-18 Thread Patrick Burns
I disagree with Dieter's last point. Whether you use 'attach' or 'load' should depend on whether you want the objects in the file to remain separate ('attach') or mixed into the global environment ('load'). Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home

Re: [R] R: constrained optimization

2009-04-28 Thread Patrick Burns
algorithm will be needed. In which case the introduction to genetic algorithms on the Tutorials page may be of use. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) mau...@alice.it wrote: Thank you

Re: [R] explicit documentation (was: get() versus getAnywhere())

2009-04-19 Thread Patrick Burns
the weather: everyone complains but no one does anything about it. Real software companies have a documentation department. Perhaps there should be a documentation department for R as well. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno

Re: [R] S+FinMetrics

2009-04-17 Thread Patrick Burns
Resources include: * Rmetrics * The finance task view on CRAN * The R-sig-finance mailing list Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Hassan Mohamed wrote: please !, what is the R

Re: [R] extract argument names

2009-04-07 Thread Patrick Burns
unlist(lapply(parse(text=a), function(x) deparse(x[[2]]))) seems to do the job. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) roger koenker wrote: I have a vector of character strings that look

Re: [R] how to do this the R way

2009-04-04 Thread Patrick Burns
You need a comma (,) not a dot (.) in your subscripting of the matrix. If I get the question correctly, you want: newTS2 - perm[100, TS2] Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) onyourmark

Re: [R] how to do this the R way

2009-04-04 Thread Patrick Burns
You can find a discussion of subscripting in pretty much any document on R. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) onyourmark wrote: Yes, That is it! Can I just make sure I understand

Re: [R] Basic doubts on the use of several script files in R batch mode

2009-04-04 Thread Patrick Burns
An alternative to Jim's route might be to create functions rather than relying entirely on scripts. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) jim holtman wrote: Create a master file

Re: [R] Matrix multiplication - code problem

2009-04-02 Thread Patrick Burns
You need to put in calls to 'as.matrix'. It's a bit tricky though -- what you want depends on whether it is the first or second subscript that has length 1. as.matrix(id_y[,,i]) if the second dimension has length 1. t(as.matrix(id_y[,,i])) if the first dimension has length 1. Patrick Burns

Re: [R] Function?

2009-04-02 Thread Patrick Burns
Would your blood still circulate if you take off your heart? That is, the answer is, No, that's where the work is done in the function. If you want to understand the computations that function is doing, then you need to examine the C code that it is calling. Patrick Burns patr...@burns

<    1   2   3   >