[R] [Fwd: adding more columns in big.matrix object of bigmemory package]

2010-12-16 Thread utkarshsinghal
Hi, With reference to the mail below, I have large datasets, coming from various different sources, which I can read into filebacked big.matrix using library bigmemory. I want to merge them all into one 'big.matrix' object. (Later, I want to run regression using library 'biglm').

Re: [R] GUI's and R background processes

2010-12-16 Thread Norm Matloff
Anne, you can accomplish your goal by using my Rdsm package, which adds a threads-like capability to R. You can download it from CRAN. Look in particular in the examples/ directory. The file WebProbe.R is pretty much exactly the same usage that you want. Look at Auction.R too. You may also

Re: [R] [R-sig-hpc] Error in makeMPIcluster(spec, ...): how to get a minimal example for parallel computing with doSNOW to run?

2010-12-16 Thread Marius Hofert
Dear Mario, I tried "-n 4" and obtain the same error :-( Cheers, Marius __ 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 commente

Re: [R] adding text to the top corner of a lattice plot

2010-12-16 Thread David Winsemius
On Dec 17, 2010, at 12:07 AM, Rajarshi Guha wrote: On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius wrote: On Dec 16, 2010, at 11:12 PM, Rajarshi Guha wrote: Hi, I have a series of lattice plots which I am arranging in a 2x2 grid via print: print(p.preds, split=c(1,1, 2,2), more=TRUE) pr

[R] excessive (?) memory utilization by package foreign when reading SAS xport file

2010-12-16 Thread Daniel Nordlund
Someone recently asked about reading the BRFSS data into R. The answer was as simple as using the foreign package to read the SAS xport dataset. I have been asked to assist someone in using R and the survey package to analyze the BRFSS survey. At work, I have a 64-bit system running Windows 7

Re: [R] [R-sig-hpc] Error in makeMPIcluster(spec, ...): how to get a minimal example for parallel computing with doSNOW to run?

2010-12-16 Thread Mario Valle
Shouldn't -n be 4 in the bsub command? One master+3 slaves. This was required for snowfall, but I think doSNOW is similar. Hope it helps mario On 16-Dec-10 23:09, Marius Hofert wrote: Dear expeRts, I try to get a minimal example for parallel computing v

Re: [R] adding text to the top corner of a lattice plot

2010-12-16 Thread Rajarshi Guha
On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius wrote: > > On Dec 16, 2010, at 11:12 PM, Rajarshi Guha wrote: > >> Hi, I have a series of lattice plots which I am arranging in a 2x2 >> grid via print: >> >> print(p.preds, split=c(1,1, 2,2), more=TRUE) >> print(p.comp, split=c(2,1,2,2), more=TRUE

Re: [R] adding text to the top corner of a lattice plot

2010-12-16 Thread Gabor Grothendieck
On Thu, Dec 16, 2010 at 11:12 PM, Rajarshi Guha wrote: > Hi, I have a series of lattice plots which I am arranging in a 2x2 > grid via print: > > print(p.preds, split=c(1,1, 2,2), more=TRUE) > print(p.comp, split=c(2,1,2,2), more=TRUE) > print(p.bw, split=c(1,2,2,2), more=FALSE) > > What I'd like

Re: [R] adding text to the top corner of a lattice plot

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 11:12 PM, Rajarshi Guha wrote: Hi, I have a series of lattice plots which I am arranging in a 2x2 grid via print: print(p.preds, split=c(1,1, 2,2), more=TRUE) print(p.comp, split=c(2,1,2,2), more=TRUE) print(p.bw, split=c(1,2,2,2), more=FALSE) What I'd like to have is a le

Re: [R] newbie question on str output

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 11:10 PM, Laura Smith wrote: Hi! Here is some output from an str command: str(CO2) Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame': 84 obs. of 5 variables: $ Plant: Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2 2 2 .

[R] adding text to the top corner of a lattice plot

2010-12-16 Thread Rajarshi Guha
Hi, I have a series of lattice plots which I am arranging in a 2x2 grid via print: print(p.preds, split=c(1,1, 2,2), more=TRUE) print(p.comp, split=c(2,1,2,2), more=TRUE) print(p.bw, split=c(1,2,2,2), more=FALSE) What I'd like to have is a letter (A, B, ...) in the top corner of each plot. While

[R] newbie question on str output

2010-12-16 Thread Laura Smith
Hi! Here is some output from an str command: > str(CO2) Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame': 84 obs. of 5 variables: $ Plant: Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2 2 2 ... $ Type : Factor w/ 2 levels "Quebec","Mississip

Re: [R] how to convert "sloppy data" into a time series?

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 8:35 PM, Mike Williamson wrote: Hi All, First let me state that I did search for a while on r-help, google, and using the "sos" package inside of 'R', without much luck. I want to know how to create a univariate time series from a set of data that will have huge t

Re: [R] Solution to differential equation

2010-12-16 Thread Ravi Varadhan
One small correction to my previous email: k1 and k2 can be any positive, real numbers, except that `k2' cannot be an integer. This is not a problem, since the integral can be easily obtained when `k2' is an integer. Before developing the power series approach, I was thinking that it might be

Re: [R] legend not appearing in Word document

2010-12-16 Thread Tim_Clark
Duncan, I am starting to think the problem is the number of colors being used in the legend when using Word 2007 and the eps file format. I have played around with the number of colors in mycol and found that it works for under 3000 colors (length mycol<3000), but I only get an empty (colorless)

[R] use vector to merge multiple xts objects?

2010-12-16 Thread jct...@gmail.com
Hi, I have several xts objects that are historical quotes downloaded as such: library(quantmod) > getSymbols("AA") > head(AA) AA.Open AA.High AA.Low AA.Close AA.Volume AA.Adjusted 2007-01-03 30.05 30.06 29.1729.33 8176300 26.89 2007-01-04 29.33 29.40 28.8129

Re: [R] Nested layout()

2010-12-16 Thread Peter Langfelder
On Thu, Dec 16, 2010 at 7:00 PM, Dario Strbenac wrote: > Hello, > > Is it possible to call a graphing function that uses layout() multiple times > and layout those outputs ? Here's a minimal example : > > myplot <- function() > { >        layout(matrix(1:2, nrow=1), widths = c(1, 1)) >        plo

Re: [R] Line Type Specification: lty=

2010-12-16 Thread jcrada
Hi Henrik, I am having the same problem with lty. I do not understand how you solved it using unlist. Were you able to solve it modifying the lty? Cheers, Juan -- View this message in context: http://r.789695.n4.nabble.com/Line-Type-Specification-lty-on-off-but-lty-off-on-tp2970669p3091707.h

Re: [R] Please help with one problem

2010-12-16 Thread diavolo_vam
Well I understand that you don`t want to help me. No problem, best regards. -- View this message in context: http://r.789695.n4.nabble.com/Please-help-with-one-problem-tp3091392p3091638.html Sent from the R help mailing list archive at Nabble.com. __

[R] Problem wiht mvbutils and timeDate in R 2.12

2010-12-16 Thread felipe araujo
Dear list, We have encountered problems with the package mvbutils while creating (or reading from disk) timeSeries objects. Below is a very simple example of the problem. We are using R 2.12 in  a PC running Windows 7  64-bit Professional. --- library(timeSeries)   cv1 <- as.character(a

[R] Nested layout()

2010-12-16 Thread Dario Strbenac
Hello, Is it possible to call a graphing function that uses layout() multiple times and layout those outputs ? Here's a minimal example : myplot <- function() { layout(matrix(1:2, nrow=1), widths = c(1, 1)) plot(1:10) plot(10:1) } layout(matrix(1:2), heights = c(1, 2)) m

[R] Multiplying complex numbers from R in C

2010-12-16 Thread Oleksandr Dyklevych
Hi! I'm trying to do some operations on complex numbers in C with returning results to R, but it seems that arithmetic operators do not overloaded for complex numbers. I mean, I try a very simple code, like #include #include #include int main(){ Rcomplex e, z, s; e.r = M_PI; e.

Re: [R] editor for MacOS

2010-12-16 Thread David L. Van Brunt, Ph.D.
Under "Edit... Text Options... Languages" there are several that are "close enough" to provide usefulness in R. Options like "Ruby", "Python", "C++", etc all help with colorizing in rule-based ways, and making sure quotes match, and every "(" has a ")", etc. Just visual aids-- I'm sure one could p

Re: [R] editor for MacOS

2010-12-16 Thread David Cross
emacs/ess/sweave work for me! http://ess.r-project.org/ http://www.stat.uni-muenchen.de/~leisch/Sweave/ Cheers David Cross d.cr...@tcu.edu www.davidcross.us On Dec 16, 2010, at 7:56 PM, Steve Lianoglou wrote: I didn't see JGR suggested yet (maybe it's like Tinn-R(?)): http://www.rforge.n

Re: [R] editor for MacOS

2010-12-16 Thread Steve Lianoglou
I didn't see JGR suggested yet (maybe it's like Tinn-R(?)): http://www.rforge.net/JGR/screenshots.html I'm a fan of the emacs/ess combo myself. -steve On Thu, Dec 16, 2010 at 10:41 AM, Troels Ring wrote: > Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running > MacOS and

[R] how to convert "sloppy data" into a time series?

2010-12-16 Thread Mike Williamson
Hi All, First let me state that I did search for a while on r-help, google, and using the "sos" package inside of 'R', without much luck. I want to know how to create a univariate time series from a set of data that will have huge time gaps in it. For instance, here is a snapshot of a piece

Re: [R] editor for MacOS

2010-12-16 Thread huang min
Dear David, I also use the build-in editor and textwrangler. How can I get the syntax highlighting in textwrangler? Huang On Fri, Dec 17, 2010 at 12:02 AM, David L. Van Brunt, Ph.D. < dlvanbr...@gmail.com> wrote: > Frankly, the built-in R editor for OS X is far better than the built-in > editor

[R] SVM Posterior Probabilities

2010-12-16 Thread Vijayakumar Ramachandran
I am using SVM in R via package e1071 package. Is it possible to obtain probabilities of the classification for the test set based on distances from the classification planes? This seems possible in Linear Discriminant Analysis (via lda function in MASS package) through the posterior probabil

Re: [R] Please help with one problem

2010-12-16 Thread Jannis
Hi, I would suggest two things: 1. Use a subject related to your problem when posting to the list! 2. State a question (as Sarah has already said)! Like this nobody can really understand what you want (or at least I cant!). Jannis diavolo_vam schrieb: It is interesting to graph the distribu

Re: [R] Compare two dataframes

2010-12-16 Thread Michael Bedward
Hello Mark, This is how I do it but it's longer than your code :) unique.rows <- function (df1, df2) { # Returns any rows of df1 that are not in df2 out <- NULL for (i in 1:nrow(df1)) { found <- FALSE for (j in 1:nrow(df2)) { if (all(df1[i,] == df2[j,])) { found <- T

Re: [R] moving average with gaps in time series

2010-12-16 Thread Jannis
Hi Josef, is there any particular reason why you want to use your own function? Have a look at the stats functions or special timeseries functions for R. I am sure you will find something that calculates an ordinary moving average (and a bunch of fancier stuff). 'filter' (stats) for example

[R] Revolutions Blog: November Roundup

2010-12-16 Thread David Smith
I write about R every weekday at the Revolutions blog:  http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from the month of November: Di

Re: [R] my function does not work for large data set

2010-12-16 Thread Changbin Du
Thanks Jim1 I will split the data and rum again. On Thu, Dec 16, 2010 at 2:57 PM, Jim Holtman wrote: > I think that your object exceeds the limit of 2^31 elements. > > Sent from my iPad > > On Dec 16, 2010, at 17:44, Changbin Du wrote: > > > Dear R community, > > > > I have one function, it w

Re: [R] my function does not work for large data set

2010-12-16 Thread Jim Holtman
I think that your object exceeds the limit of 2^31 elements. Sent from my iPad On Dec 16, 2010, at 17:44, Changbin Du wrote: > Dear R community, > > I have one function, it works for small data set, but does not work on large > data set, can anyone help me with this? > >> #creat new variable

[R] my function does not work for large data set

2010-12-16 Thread Changbin Du
Dear R community, I have one function, it works for small data set, but does not work on large data set, can anyone help me with this? > #creat new variable by dividing each aa dimer by total_length. > imper<-function(x, file) { +round(x/file$length, 5) + }

[R] moving average with gaps in time series

2010-12-16 Thread Carl Witthoft
I'm not completely sure what your test setup does, but wouldn't it be simpler to take a moving average at every point, but set the window dynamically to be over the previous hour? In pseudocode, for the j-th sample: meanval[j] <- mean(Value[ DateTime[(DateTime-DateTime[j])>0 & (Datetime-DateT

Re: [R] Code for The R Book

2010-12-16 Thread Paul Miller
Hi Carlos,   Unfortunately, I don't think I can get the code there. I've been to the website before, and all I've been able to find is data. At first, I thought that was all that had ever been there. But when I got to the end of The R Book the first time, I noticed a statement indicating that an

Re: [R] editor for MacOS

2010-12-16 Thread stephen sefick
You will get as many suggestions as there are people and here is mine- I like gedit. I would move that this be added to the FAQs as it seems to pop up quite often. Stephen On Thu, Dec 16, 2010 at 4:38 PM, Jakson A. Aquino wrote: > On Thu, Dec 16, 2010 at 12:41 PM, Troels Ring wrote: >> Dear fr

Re: [R] editor for MacOS

2010-12-16 Thread Jakson A. Aquino
On Thu, Dec 16, 2010 at 12:41 PM, Troels Ring wrote: > Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running > MacOS and is just starting using R and I know nothing about MacOS and R but > we seem to have difficulties in finding something similar to Tinn for MaC. > What are

Re: [R] editor for MacOS

2010-12-16 Thread Erich Neuwirth
TextMate from www.macromates.com is a very nice editor, similar in power to Emacs, but much more Macish. It has its own subculture with many macro packages. It is NOT free, but not very expensive either. redcar available from http://redcareditor.com/ open source sibling of TextMate running on diff

Re: [R] editor for MacOS

2010-12-16 Thread Tobias Verbeke
On 12/16/2010 04:54 PM, Marc Schwartz wrote: On Dec 16, 2010, at 9:41 AM, Troels Ring wrote: Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running MacOS and is just starting using R and I know nothing about MacOS and R but we seem to have difficulties in finding somethi

Re: [R] Solution to differential equation

2010-12-16 Thread Ravi Varadhan
Hi Mahesh, Here is a solution to your problem. I have used the power-series approach. You can solve for any positive value of k1 and k2 (except that k2 cannot be unity). I think this is correct, but you can compare this with a numerical ODE solver, if you wish. pseries <- function(u, k2, eps=

[R] Optim function with meta parameters

2010-12-16 Thread albechan
Hi guys. I have a dataset with 4 columns. In the first and second column I have the same qualitative variable referred to different teams of people. There are 10 teams in total and they compete against each other to perform a certain task whose result is stored in the third column for the team rec

Re: [R] Code for The R Book

2010-12-16 Thread Carlos Ortega
Hello, You can find the code here: http://www.bio.ic.ac.uk/research/mjcraw/therbook/index.htm Regards, Carlos Ortega. On Thu, Dec 16, 2010 at 9:31 PM, Paul Miller wrote: > Hello Everyone, > > Does anyone have the R code for this book

Re: [R] Arguments in functions

2010-12-16 Thread Phil Spector
Paul - Please take a look at the help file for boot, i.e. type ?boot at the R prompt. There you will see, along with other information: statistic: A function which when applied to data returns a vector containing the statistic(s) of interest. When ‘sim="parametric"’

[R] understanding the 4 parameter logisitc regression

2010-12-16 Thread 1Rnwb
I have questions regarding test=data.frame(cbind(conc=c(25000, 12500, 6250, 3125, 1513, 781, 391, 195, 97.7, 48.4, 24, 12, 6, 3, 1.5, 0.001), il10=c(330269, 216875, 104613, 51372, 26842, 13256, 7255, 3049, 1849, 743, 480, 255, 241, 128, 103, 50))) nls(log(il10)~A+(B-A)/(1+(conc/xmid )^scal),da

[R] moving average with gaps in time series

2010-12-16 Thread Josef . Kardos
I have a time series with interval of 2.5 minutes, or 24 observations per hour. I am trying to find a 1 hr moving average, looking backward, so that moving average at n = mean(n-23 : n) The time series has about 1.5 million rows, with occasional gaps due to poor data quality. I only want to t

[R] Code for The R Book

2010-12-16 Thread Paul Miller
Hello Everyone,   Does anyone have the R code for this book? I contacted the author about this and was told that it used to be on the book's website, but that the publisher had asked that it be taken down. I'm hoping that someone will have downloaded the code when it was available, and that they

[R] Arguments in functions

2010-12-16 Thread Prew, Paul
Hello, I'm not much of a programmer, and am trying to understand the workings of the function below called "RStatFctn" within this bootstrap procedure. RStatFctn is defined to have two arguments: "x", intended to be a data vector; and "d" intended to be an index (or so it looks to me). Later

Re: [R] LaTeX, MiKTeX, LyX: A Guide for the Perplexed

2010-12-16 Thread Paul Miller
Hello Everyone,   Thanks to all who replied to my earlier message. I got quite a few responses and several suggestions about how to create nice looking documents that incorporate output from R. It took some time to investigate these, and in some ways I'm more perplexed than when I started.   Af

Re: [R] Please help with one problem

2010-12-16 Thread Sarah Goslee
Please see the second half of my original reply, reprinted here for your convenience: Failing that, what have you tried? Have you gotten error messages or otherwise gone wrong? We will help with specific R questions presented with complete information as described in the posting guide. This isn't

Re: [R] Please help with one problem

2010-12-16 Thread Jeff Newmiller
Whether you selected the problem or a teacher did, you need to stay on topic and provide specific examples of code you have tried with sample input data as needed to make the code self-contained. Ask about R, not basic statistics. "diavolo_vam" wrote: > >Hello Sarah, >Thank you for your post,

Re: [R] Please help with one problem

2010-12-16 Thread diavolo_vam
Hello Sarah, Thank you for your post, but this is one task from simpleR book, and I want to understand the lesson. If you don`t want to help me, OK no problem, but if anyone can help let do it. -- View this message in context: http://r.789695.n4.nabble.com/Please-help-with-one-problem-tp3091

[R] Compare two dataframes

2010-12-16 Thread Mark Na
Hello, I have two dataframes DF1 and DF2 that should be identical but are not (DF1 has some rows that aren't in DF2, and vice versa). I would like to produce a new dataframe DF3 containing rows in DF1 that aren't in DF2 (and similarly DF4 would contain rows in DF2 that aren't in DF1). I have a so

Re: [R] Question

2010-12-16 Thread Bert Gunter
... Depends on the sampled population. If all children under 6, I'd expect it to be quite skew. If all second graders, I would expect it to be more symmetric. Though, sadly these days, there's probably a long tail to the right, at least in developed countries and especially here in the U.S.. Chee

Re: [R] xyplot

2010-12-16 Thread Andrew Miles
Try sample() which will allow you to randomly select 10 ID's from your ID variable, which you can then plot. Andrew Miles On Dec 16, 2010, at 10:49 AM, Rasanga Ruwanthi wrote: Hi I am using following code to produce a xyplot for some longitudinal data. There are 2 panels. It produced all

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread Philipp Pagel
> Saving the session history is indeed easy (savehistory). > The problem is the playback. I didn't find a reliable method. Well, you could simply source() the .Rhistory file (or the file you saved under some other name). But as you already poitned out - it's better to go with scripts to begin wit

Re: [R] Please help with one problem

2010-12-16 Thread Sarah Goslee
My first instinct is to suggest that you ask your professor or TA for help, since this looks remarkably like a homework problem. We are not here to do your work for you. Failing that, what have you tried? Have you gotten error messages or otherwise gone wrong? We will help with specific R question

Re: [R] 300 dpi and eps:

2010-12-16 Thread Philipp Pagel
> Can someone recommend some paper that makes clear the relation and > distinctions between vector and raster graphics, but especially with > some practical examples in regard to what is the relation between > page (height and width) and dpi. I'm not aware of a paper, but it's really not rocket s

Re: [R] legend not appearing in Word document

2010-12-16 Thread Robert Baer
On 12/12/2010 8:59 AM, Tim Clark wrote: I need help with using graphics in Word 2007 that will later be converted into a pdf document. I have tried several formats and found that I get the best quality of graphics using .wmf, .eps format, but when I convert it to .pdf I get a bunch of lines ac

[R] xyplot

2010-12-16 Thread Rasanga Ruwanthi
Hi   I am using following code to produce a xyplot for some longitudinal data. There are 2 panels. It produced all longitudinal trajectories with mean profile. But since the dataset it very large plot looks very messy. I want to show, say 10 randomly selected individual longitudinal trajectories

[R] Please help with one problem

2010-12-16 Thread diavolo_vam
It is interesting to graph the distribution of the standardized average as n increases. Do this when the Xi are uniform on [0; 1]. Look at the histogram when n is 1, 5, 10 and 25. Do you see the normal curve taking shape? (A rule of thumb is that if the Xi are not too skewed, then n > 25 should ma

Re: [R] Question

2010-12-16 Thread csrabak
Em 14/12/2010 12:46, Matthew Rosett escreveu: How do I determine if my data deviate from the normal distribution? The sample size is 1000 (weights of people). As others already posted about the Statistical theoretic aspects of it, I want to add that weights of people are not normal distributed

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread Roy Shimizu
Thank you all. I experimented with the various suggestions you proposed. Saving the session history is indeed easy (savehistory). The problem is the playback. I didn't find a reliable method. Plus, I now realize that the very idea of playing back a saved session is, in general, a bad one, since

Re: [R] find closest match between two vectors

2010-12-16 Thread Phil Spector
Jannis - One approach is as follows: one = c(1,2,6) two = c(0,0.5,1,2,3,8) findit = function(x,vec){ + y = vec - x + y[y<=0] = NA + if(all(is.na(y)))NA else which.min(y) + } > sapply(two,findit,one) [1] 1 1 1 2 3 NA - Phil Spector

Re: [R] find closest match between two vectors

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 12:31 PM, Jannis wrote: Dear list, I hope I can define my problem in an understandable manner. I seek some funktion that finds me the index of the value in a vector 1 that is the least bigger then the value in another vector 2. And this for all values in vector 2.

[R] find closest match between two vectors

2010-12-16 Thread Jannis
Dear list, I hope I can define my problem in an understandable manner. I seek some funktion that finds me the index of the value in a vector 1 that is the least bigger then the value in another vector 2. And this for all values in vector 2. For example: vector 1 : c(1,2,6) vector 2 : c(0

Re: [R] Numbers in a string

2010-12-16 Thread William Dunlap
In S+ strsplit() has a keep=TRUE/FALSE argument to specify whether to return the substrings that match the pattern or to return the substrings between matches to the pattern (the default). E.g., > strings <- c("abcde. 11 abc 5.31e+34, (1.45)", "AB15E9SDF654VKBN?dvb.65") > number.pattern <- "[0-9]

Re: [R] editor for MacOS

2010-12-16 Thread Marc Schwartz
On Dec 16, 2010, at 10:26 AM, peter dalgaard wrote: > On Dec 16, 2010, at 16:54 , Marc Schwartz wrote: > >> On Dec 16, 2010, at 9:41 AM, Troels Ring wrote: >> >>> Dear friends - I'm using Tinn-R in Windows and find it OK. My son is >>> running MacOS and is just starting using R and I know nothi

Re: [R] Numbers in a string

2010-12-16 Thread Petr Savicky
On Thu, Dec 16, 2010 at 06:17:45AM -0800, Dieter Menne wrote: > Petr Savicky wrote: > > > > One of the suggestions in this thread was to use an external program. > > A possible solution without negation in Perl is > > > > @a = ("AB15E9SDF654VKBN?dvb.65" =~ m/[0-9]/g); > > print @a, "\n"; > >

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread Greg Snow
To just save a copy of all the commands issued you can use the savehistory function (this is documented on the same page as history, so David's answer would have lead you there as well). If you want to save all the outputs from you session you can use the sink function. You can save a combinat

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread Rob Goedman
Roy, In addition to previous responses, another way of achieving this is to only work from scripts. I rarely type anything directly into R, just edit scripts in an editor and then execute the entire script (or parts of the script) from within the editor. This way of working provides backup, e.

Re: [R] editor for MacOS

2010-12-16 Thread peter dalgaard
On Dec 16, 2010, at 16:54 , Marc Schwartz wrote: > On Dec 16, 2010, at 9:41 AM, Troels Ring wrote: > >> Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running >> MacOS and is just starting using R and I know nothing about MacOS and R but >> we seem to have difficulties in

Re: [R] editor for MacOS

2010-12-16 Thread David L. Van Brunt, Ph.D.
Frankly, the built-in R editor for OS X is far better than the built-in editor for Windows, in my opinion having used both. I've never found the need for something like TinnR on the Mac side-- but I have used TextWrangler on occasion and enjoyed the syntax highlighting, line numbering, etc. http:/

Re: [R] Adding graphs to a map

2010-12-16 Thread Greg Snow
The symbols function can add symbols (including boxplot style boxes) to an existing plot (your map for example). The subplot function in the TeachingDemos package can add entire plots (including boxplots) to an existing plot. Both the above work with base graphs only, not grid (lattice, ggplot

[R] Subarray specification problem

2010-12-16 Thread Roy Shimizu
Hi. I'm new to R, and I'm still learning R's system for addressing subsets of data structures. I'm particularly interested in the problem of selecting subarrays based on complex criteria involving the dimnames (as opposed to the values of the cells) of the array. Here's an example of such a prob

Re: [R] Reset R to a vanilla state

2010-12-16 Thread Marc Schwartz
If you are using Emacs/ESS/org-mode etc., you may be better of posting to the ESS-Help list, where there are folks that I know of who are engaged in using org-mode for R coding and documentation. They may be able to offer some insights into their practices. More info at: https://stat.ethz.ch

Re: [R] editor for MacOS

2010-12-16 Thread Marc Schwartz
On Dec 16, 2010, at 9:41 AM, Troels Ring wrote: > Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running > MacOS and is just starting using R and I know nothing about MacOS and R but > we seem to have difficulties in finding something similar to Tinn for MaC. > What are yo

Re: [R] Reset R to a vanilla state

2010-12-16 Thread Holger Hoefling
Hi, I am writing code in Emacs using org-mode and babel. I have a number of code blocks that are tangled into several files with some files spanning several code blocks. Each of these files is supposed to run independently of each other on a clean version of R, however I also want to be able to ex

[R] editor for MacOS

2010-12-16 Thread Troels Ring
Dear friends - I'm using Tinn-R in Windows and find it OK. My son is running MacOS and is just starting using R and I know nothing about MacOS and R but we seem to have difficulties in finding something similar to Tinn for MaC. What are your suggestions? Thanks a lot! Troels Ring, MD Aalborg, D

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 10:19 AM, David Winsemius wrote: On Dec 16, 2010, at 9:56 AM, baptiste auguie wrote: Hi, The fastest way seems to be, all(x[1] == x) I'm sure that is more efficient than this methods: patt <- paste("^",x[1],"$", sep="") length( grep(patt, x) == length(x) ) Wrong po

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 9:56 AM, baptiste auguie wrote: Hi, The fastest way seems to be, all(x[1] == x) I'm sure that is more efficient than this methods: patt <- paste("^",x[1],"$", sep="") length( grep(patt, x) == length(x) ) ... but sometimes it helps to have strategies that might generali

Re: [R] Reset R to a vanilla state

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 10:01 AM, jim holtman wrote: exit from the current session and startup a new one. Possibly with an additional step of deleting .Rdata from the working directory. On Thu, Dec 16, 2010 at 9:12 AM, Holger Hoefling wrote: Hi all, I need some help with R. I am lookin

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 9:43 AM, Roy Shimizu wrote: I know that at the end of an R session I'm given the option to save the current *state* of the session. But I would like to save the entire sequence of inputs that took place during the session, so that I can play them back later, and not only be

Re: [R] How to save & play back an entire R session?

2010-12-16 Thread Duncan Murdoch
On 16/12/2010 9:43 AM, Roy Shimizu wrote: I know that at the end of an R session I'm given the option to save the current *state* of the session. But I would like to save the entire sequence of inputs that took place during the session, so that I can play them back later, and not only be left in

Re: [R] Reset R to a vanilla state

2010-12-16 Thread jim holtman
exit from the current session and startup a new one. On Thu, Dec 16, 2010 at 9:12 AM, Holger Hoefling wrote: > Hi all, > > I need some help with R. I am looking for a function that puts R back into a > vanilla state (exactly the same when I just started it). Specifically I want > all objects in t

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread baptiste auguie
Hi, The fastest way seems to be, all(x[1] == x) HTH, baptiste On 16 December 2010 15:17, Jannis wrote: > Dear list, > > > this might be an easy one, but I could figure out a solution (or how to > google the right term). > > Is there any way to test whether all elements of a vector are identi

[R] How to covernt this list to data.frame?

2010-12-16 Thread Fabrice Tourre
using dget to try this data. dget("probesnum")->a some data length is 3, some is 4. thanks. __ 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

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread David Winsemius
On Dec 16, 2010, at 9:17 AM, Jannis wrote: Dear list, this might be an easy one, but I could figure out a solution (or how to google the right term). Is there any way to test whether all elements of a vector are identical? ?identical For numeric vectors I would use sum(diff(vector

[R] How to save & play back an entire R session?

2010-12-16 Thread Roy Shimizu
I know that at the end of an R session I'm given the option to save the current *state* of the session. But I would like to save the entire sequence of inputs that took place during the session, so that I can play them back later, and not only be left in the same state I was at the time of saving

[R] defining a formula method for a weighted lm()

2010-12-16 Thread Michael Friendly
In the vcdExtra package on R-Forge, I have functions and generic methods for calculating log odds ratios for R x C x strata tables. I'd like to define methods for fitting weighted lm()s to the resulting loddsratio objects, but I'm having problems figuring out how to do this generally. # install

[R] Optimal method to scan cells and set flag

2010-12-16 Thread Jon Erik Ween
Hi I am still working on my large dataset (sample attached) that contains a series of binary variables (flags, yes/no) regarding affected brain areas ("Lica","LAtChor","LA1" ,etc). I need to scan these columns, if value = Y for "Lxxx" set "LesionSide" to "L", if Y for "Rxxx" set to "R" and "B"

[R] Help on neural network

2010-12-16 Thread sadanandan
Hi all, I am trying to develop a neural network(Multilayer perceptron) with the package 'NEURALNET'. I have some doubts on it, 1. Whether this procedure taken care about categorical input variables- The reason is I could not find any option to describe type of variable in the arguments? 2.The alg

Re: [R] Reset R to a vanilla state

2010-12-16 Thread Georg Ruß
On 16/12/10 15:12:47, Holger Hoefling wrote: > Specifically I want all objects in the workspace removed rm(list=ls()) should do this trick. > and all non-base packages detached and unloaded You may obtain the list of loaded packages via (.packages()) Store this at the beginning of your session

Re: [R] How can I draw a line in empirical distribution function?

2010-12-16 Thread Dieter Menne
zbynek.jano...@gmail.com wrote: > > I believe that functions > yline {fields} > xline {fields} > are what you´re looking for > try to type > yline(c(.25,.75)) > It work, but one should avoid pulling in a special package for such a job. xline is defined as function (x, ...) { abline(v = x

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread Jannis
Thanks Tal. Sometimes easy solutions are close by but hard to find when one is focused on the wrong direction :-)! Jannis Tal Galili schrieb: How about: length(unique(vector)) >1 ? Contact Details:--- Contact me: tal.gal..

Re: [R] test whether all elements of a vector are identical

2010-12-16 Thread Tal Galili
How about: length(unique(vector)) >1 ? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) -

Re: [R] Integrate two function in R

2010-12-16 Thread Jonathan P Daily
As a minor plug for my favorite non stat-based mathematics software, sagemath also has a rudimentary R interface built-in -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a

[R] test whether all elements of a vector are identical

2010-12-16 Thread Jannis
Dear list, this might be an easy one, but I could figure out a solution (or how to google the right term). Is there any way to test whether all elements of a vector are identical? For numeric vectors I would use sum(diff(vector)==0)==0 but I have character vectors. Any Ideas? Cheers Janni

Re: [R] Numbers in a string

2010-12-16 Thread Dieter Menne
Petr Savicky wrote: > > One of the suggestions in this thread was to use an external program. > A possible solution without negation in Perl is > > @a = ("AB15E9SDF654VKBN?dvb.65" =~ m/[0-9]/g); > print @a, "\n"; > 15965465 > > Which is gsub("[^0-9]", "", "AB15E9SDF654VKBN?dvb.65")

  1   2   >