Re: [R] Can scan() detect end-of-file?

2015-10-19 Thread William Dunlap
> I would like to read a connection line by line with scan but > don't know how to tell when to quit trying. Is there any > way that you can ask the connection object if it is at the end? I found that adding the argument blank.lines.skip=FALSE to the scan command will do the trick when nlines=1.

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
What is the class attribute of your (misnamed) x.pt argument? If it does not inherit from class "func" then your plot.func method will not be used when you call plot(). You would need to explicitly call plot.func() instead. If this question/comment makes no sense to you, then you have some serious

Re: [R] warning on generic function when building R package

2015-10-19 Thread Jim Lemon
I think what you may have done is simply changed x.init= to x=x.init. x.init may or may not be there when the function is called, and that is what the warning is saying. While you have satisfied the restriction that the first argument must be "x", but then set the default value to something that R

[R] Bollinger Band quantmod

2015-10-19 Thread bgnumis bgnum
Hi all, When I plot Bollinger bands with chartSeries( IBEX,theme="white", TA = c(addBBands(50,2)) ) There is a "no" shadow area that it is used to obtain the levels. How can I plot with charSeries so that the plot start on the shadow area? I mean, ¿How can I say to de axis start plotting f.i

Re: [R] leveneTest between 2-levels of 3-level factor in R?

2015-10-19 Thread Rolf Turner
On 20/10/15 01:02, Dr. Leigh S. Sutherland wrote: Still feeling my way around using R... What I have done so far: I have a data.frame 'results' with response 'Fail', and three factors 'PREP', 'CLEAN' & 'ADHES'. ADHES has 3 levels: Crest Cryst Poly I calculated the variances: sigma..k=tapply(F

Re: [R] warning on generic function when building R package

2015-10-19 Thread carol white via R-help
In effect, this works but whether I use x or x.init, y or y.init in plot.func, I get no visible binding for global variable ‘x.init’no visible binding for global variable ‘y.init’ Regards, On Monday, October 19, 2015 9:59 PM, Duncan Murdoch wrote: On 19/10/2015 3:50 PM, carol white

Re: [R] Plotting EEG signals as a "head" using R

2015-10-19 Thread Charles Novaes de Santana
Thanks a lot, Dénes!! This library is very good! I can plot the head even in 3D using the command "eegspace(space,voltage)", in which "space" defines the position of the electrodes and voltage is the voltage of my EEG signal :) Simple and elegant! :) Thanks! Best, Charles On 19 October 2015

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
On 19/10/2015 3:50 PM, carol white wrote: > Thanks Murdoch. > > defining > plot.func<- function(x=x.init, y=y.init, arg3, arg4, "title", col, arg5) > > and if plot doesn't take the exact parameters of plot.func but modified > of these parameters > plot(x=x.pt,y=y.pt,xlim = c(0, 10), ylim = c(0,1)

Re: [R] warning on generic function when building R package

2015-10-19 Thread carol white via R-help
Thanks Murdoch. defining plot.func<- function(x=x.init, y=y.init, arg3, arg4, "title", col, arg5) and if plot doesn't take the exact parameters of plot.func but modified of these parametersplot(x=x.pt,y=y.pt,xlim = c(0, 10), ylim = c(0,1), xlab= "xlab", ylab="ylab", main = "title", col = col,type

Re: [R] (no subject)

2015-10-19 Thread William Dunlap
You are making a long list with multiple components with the same name. You probably want to make list of lists, with each component list representing one employee.E.g., > Empl1 <- list(employee="Anna",spouse="Fred",children=3, + child.ages=c(4,7,9),employee="John",spouse="Mary",children=2,

Re: [R] (no subject)

2015-10-19 Thread FERNANDO MANSITO CABALLERO
Hi, I am very grateful to you all, because (as you well know) if you make the database flat, > Empl1 <- list(employee="Anna",spouse="Fred",children=3, + child.ages=c(4,7,9),employee="John",spouse="Mary",children=2, + child.ages=c(14,17)) adding a record with the same status as the first ones is

Re: [R] condition in triple summation

2015-10-19 Thread Sherouk Moawad via R-help
| If for example I have a double sammation on (xj+xi)The first summation from 1 to 3 And second summation is from 1 to 2If I put the condition of (i>j ) then the term (x1+x1) will not be included I need to cut the condition into tow parts If i&j>1 then i>jWhile if i=1 then i>=jSo that the term

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
... (Following up on Duncan) and see also ?plot and ?plot.default for argument details. Bert On Monday, October 19, 2015, Duncan Murdoch wrote: > On 19/10/2015 1:29 PM, carol white via R-help wrote: > > Hi,I have invoked plot in a function (plot.func) as follows but when I > check the built pac

Re: [R] warning on generic function when building R package

2015-10-19 Thread Duncan Murdoch
On 19/10/2015 1:29 PM, carol white via R-help wrote: > Hi,I have invoked plot in a function (plot.func) as follows but when I check > the built package, I get a warning: > plot(x.pt,y.pt,xlim = c(0, 10), ylim = c(0,1), xlab= "xlab", ylab="ylab", > main = "title", col = col,type = "l") > R CMD ch

Re: [R] warning on generic function when building R package

2015-10-19 Thread Jeff Newmiller
I would guess that x.pt does not have class "func", whatever that is. You really ought to read the manual section indicated in the error. --- Jeff NewmillerThe . . Go Live... DCN:

Re: [R] warning on generic function when building R package

2015-10-19 Thread Bert Gunter
Have you read the manual as requested? It will answer your question. Bert On Oct 19, 2015 6:31 PM, "carol white via R-help" wrote: > Hi,I have invoked plot in a function (plot.func) as follows but when I > check the built package, I get a warning: > plot(x.pt,y.pt,xlim = c(0, 10), ylim = c(0,1),

[R] warning on generic function when building R package

2015-10-19 Thread carol white via R-help
Hi,I have invoked plot in a function (plot.func) as follows but when I check the built package, I get a warning: plot(x.pt,y.pt,xlim = c(0, 10), ylim = c(0,1), xlab= "xlab", ylab="ylab", main = "title", col = col,type = "l")  R CMD check my.package checking S3 generic/method consistency ... WARNI

Re: [R] optimization problem

2015-10-19 Thread Hector Villalobos
Thanks to all who responded, I've found a very useful code here: http://courses.washington.edu/fish507/notes.html In particular the Lecture 3... Héctor 2015-10-17 7:05 GMT+00:00 Berend Hasselman : > > Your model is producing -Inf entries in the vector Be (in function modl > and LL) at some s

Re: [R] value of variable in ls()

2015-10-19 Thread peter dalgaard
On 19 Oct 2015, at 16:16 , James Toll wrote: > >> On Oct 18, 2015, at 10:51 AM, Christian Hoffmann >> wrote: >> >> How can I do e.g. print("unknown"(ls())) and get the variable values in my >> current environment? > > From your example, it sounds like what you want is simply this: > > sap

Re: [R] value of variable in ls()

2015-10-19 Thread James Toll
> On Oct 18, 2015, at 10:51 AM, Christian Hoffmann > wrote: > > How can I do e.g. print("unknown"(ls())) and get the variable values in my > current environment? >From your example, it sounds like what you want is simply this: sapply(ls(), get) James __

Re: [R] sub-sample my data in R from two different tables

2015-10-19 Thread jim holtman
I all you are doing is matching a single column and then extracting rows that match, then the '%in%' operator should work: indx <- reg6idGlobal$alloc_key %in% req6id_subsample_key$alloc_key my_subset <- reg6idGlobal[indx, ] Jim Holtman Data Munger Guru What is the problem that you are trying t

Re: [R] condition in triple summation

2015-10-19 Thread jim holtman
Not sure I understand what your condition 'i > j > k' means in the context of where each of the values is 1:3. The only value that meets that condition is i =3, j=2 & k=1, but you said exclude any cases where the values were equal to 1. Can you clarify with an example what you mean. Jim Holtman

[R] leveneTest between 2-levels of 3-level factor in R?

2015-10-19 Thread Dr. Leigh S. Sutherland
Still feeling my way around using R... What I have done so far: I have a data.frame 'results' with response 'Fail', and three factors 'PREP', 'CLEAN' & 'ADHES'. ADHES has 3 levels: Crest Cryst Poly I calculated the variances: sigma..k=tapply(Fail,ADHES,var) print(sqrt(sigma..k)): CrestCrys

Re: [R] library(nlme) groupedData question‏

2015-10-19 Thread Andre Mikulec
All, Some trial and error follows ( for anyone who cares ). The case seems that groupedData does not like to have both "a grouping" and "an outher" defined at the same time. library(nlme) d.x <- read.table(header=TRUE, text=" o g h i d A C E G 1.0 A C E H 2 A C F G 4 A C F

Re: [R] Plotting EEG signals as a "head" using R

2015-10-19 Thread Dénes Tóth
Hi, the eegkit package (https://cran.r-project.org/web/packages/eegkit/index.html) might help you if you happen to work with a standard electrode cap. Best, Denes On 10/19/2015 02:41 PM, Charles Novaes de Santana wrote: Dear all, I have .csv file with the evoked potential of different

Re: [R] condition in triple summation

2015-10-19 Thread Sherouk Moawad via R-help
If I'm summing over (i,j,k) each from 1 to 3 And I have �condition that (i>j>k) But I want to restrict this condition to only cases where i,j,k>1 Sent from Yahoo Mail on Android From:"Jeff Newmiller" Date:Mon, Oct 19, 2015 at 1:24 AM Subject:Re: [R] condition in triple summation Learn to post

[R] Plotting EEG signals as a "head" using R

2015-10-19 Thread Charles Novaes de Santana
Dear all, I have .csv file with the evoked potential of different electrodes of a human subject and I would like to plot a head figure representing the evoked potentials. My csv file has 1000 lines (from 1ms to 1000 ms) and 12 columns (each column for an electrode I am studying). Do you know a wa

Re: [R] Problem in generating any model with my dataset in R

2015-10-19 Thread Bhawana Sahu
I got the solution, Problem was due to replacement of NA Thank you so much On Mon, Oct 19, 2015 at 5:13 PM, Fox, John wrote: > Dear Bhawana Sahu, > > You don't show any of the commands that you used to produce this error, so > one can only guess at its source, but the error message you quote s

Re: [R] Problem in generating any model with my dataset in R

2015-10-19 Thread Fox, John
Dear Bhawana Sahu, You don't show any of the commands that you used to produce this error, so one can only guess at its source, but the error message you quote seems reasonably clear -- apparently, you failed to specify the data argument to the function(s) you called. For example, with a data

Re: [R] Problem in generating any model with my dataset in R

2015-10-19 Thread PIKAL Petr
Hi Why do you replace NA with meaningless „-„? NA for R means Not Available and R can handle it properly. „-„ means „-„ for R and is treated as character together with rest of the column. If somebody aviced it to you, do not trust him any more. Anyway, you still do not provide info about data.

Re: [R] sub-sample my data in R from two different tables

2015-10-19 Thread Michael Dewey
Dear John I suspect ?merge will help here. You would need to tidy up afterwards (or before) if you do not want the other columns in your dataframe of keys to be included in the result. On 19/10/2015 11:19, John Wasige wrote: ​Hi, I need help on how to sub-sample my data in R. I have two tabl

[R] sub-sample my data in R from two different tables

2015-10-19 Thread John Wasige
​Hi, I need help on how to sub-sample my data in R. I have two tables, one table with global dataset and another with a list of codes for sub sample the global dataset. ​ Download link ​ https://www.wetransfer.com/downloads/a53aa3f722b2d2887b60b09239f7c4e620151018152100/ad852e ​ ​All these tabl

Re: [R] Problem in generating any model with my dataset in R

2015-10-19 Thread PIKAL Petr
Hi Your objects are not so big, therefore I assume that something is wrong with their stucture, especially when one object gives you results. I wonder if you get more precise answer without providing some basic facts (structure of data, code, OS, R version). Cheers Petr > -Original Messag

Re: [R] No speed up using the parallel package and ncpus > 1 with boot() on linux machines

2015-10-19 Thread Jeff Newmiller
Regarding cores... The only reliable way I have found so far is to look up the processor specs. In your case I found [1] which says 4 cores. [1] http://ark.intel.com/m/products/64900/Intel-Core-i7-3615QM-Processor-6M-Cache-up-to-3_30-GHz#@product/specifications --

[R] Problem in generating any model with my dataset in R

2015-10-19 Thread Bhawana Sahu
Dear all, I am using kernlab function for analysis of dataset containing 8000 rows and 171 column, but getting an error saying cannot allocate the memory, It is running properly with the dataset having 3000 rows and 251 column, Also when I tried this with dataset having 7000 rows and 171 column g