[R] Print all In new window R 3.4.1 post-installation problems in Mac OSX 10.12.6

2017-08-29 Thread Ramnik Bansal
Hi, I installed R 3.4.1 on Mac OSX 10.12.6 version. On opening Preferences and trying to change the editor font by clicking the select button I get following error message in R. 2017-08-28 11:57:41.551 R[809:11355] *** RController: caught ObjC exception while processing system events. Update to

[R] nmax parameter in factor function

2017-06-03 Thread Ramnik Bansal
I have been trying to understand how the argument 'nmax' works in 'factor' function. R-Documentation states - "Since factors typically have quite a small number of levels, for large vectors x it is helpful to supply nmax as an upper bound on the number of unique values." In the code below what is

[R] Cause of error assigning NULL to element of a vector

2017-05-24 Thread Ramnik Bansal
What is the cause of the error below ? > y <- 1 > y[1] <- NULL Error in y[1] <- NULL : replacement has length zero Thanks, Ramnik [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R] [FORGED] Re: [FORGED] Logical Operators' inconsistent Behavior

2017-05-20 Thread Ramnik Bansal
2017 at 4:15 PM, Rolf Turner <r.tur...@auckland.ac.nz> wrote: > On 20/05/17 22:42, Duncan Murdoch wrote: >> >> On 20/05/2017 6:39 AM, Rolf Turner wrote: >>> >>> On 20/05/17 22:18, Duncan Murdoch wrote: >>>> >>>> On

Re: [R] [FORGED] Logical Operators' inconsistent Behavior

2017-05-19 Thread Ramnik Bansal
Taking this question further. If I use a complex number or a numeric as an operand in logical operations, to me it APPEARS that these two types are first coerced to LOGICAL internally and then THIS logical output is further used as the operand. For eg. > x <- 4+5i; c(x & F, x & T, x | F, x | T)

[R] Logical Operators' inconsistent Behavior

2017-05-19 Thread Ramnik Bansal
Hi, I need to understand the inconsistent behaviour of & and I operators when used with NA. The code below explains this inconsistency > TRUE & NA [1] NA > FALSE & NA [1] FALSE > TRUE & NA [1] NA > FALSE | NA [1] NA > TRUE | NA [1] TRUE > TRUE == NA [1] NA > FALSE == NA [1] NA

Re: [R] Return value from function with For loop

2017-04-17 Thread Ramnik Bansal
thing is returned, not even NULL > >> for(i in 1:3) i > > ## Ditto > > > >> z <- NULL > >> z <- for(i in 1:3)i > >> z > > NULL ## still > > > > Cheers, > > Bert > > > > > > > > > > Cheers, >

[R] Return value from function with For loop

2017-04-16 Thread Ramnik Bansal
In the code below *ff <- function(n){ for(i in 1:n) (i+1)}* *n<-3;ff(n)->op;print(op)* Why doesnt *print(op) * print 4 and instead prints NULL. Isnt the last line of code executed is *i+1 * and therefore that should be returned instead of NULL instead if I say *ff <- function(n){ (n+1) }*

[R] what does this syntax mean in R

2017-04-16 Thread Ramnik Bansal
​I am not able to understand the output of the following lines of code. *if(TRUE)(print("A"))​* Versus *if(TRUE){print("A"))* *In first case I get the ooutput as * *>[1] "A"* *>[1] "A"* *Why does the first case print "A" twice * *Why does it not happen with the statement

[R] Default value of Numerals argument in read.table function R 3.3.2 on Mac

2017-03-24 Thread Ramnik Bansal
Hi, The help file for function read.table mentions the default value for the argument numerals as c("allow.loss", "warn.loss", "no.loss") How are the three values used as default values ? Thanks Ramnik [[alternative HTML version deleted]]

[R] explicit coercion warnings as.numeric Versus as.logical

2016-11-21 Thread Ramnik Bansal
Hi, I am trying to understand under which specific conditions does explicit coercion produce warnings. > as.numeric(c(1, F, "b")) [1] 1 NA NA Warning message: NAs introduced by coercion > as.logical(c(1, F, "b")) [1]NA FALSENA In above examples, as.numeric produces warning but

[R] R 3.2, Mac 10.10.3 : help.search showing error

2015-06-13 Thread Ramnik Bansal
Getting following error in using help.search utils::help.search(linear models) Error in help(db[i, topic], package = db[i, Package], lib.loc = lib, : 'topic' should be a name, length-one character vector or reserved word example(help.search) hlp.sr help.search(linear models)# In case

Re: [R] R 3.2, Mac 10.10.3 : help.search showing error

2015-06-13 Thread Ramnik Bansal
Thanks. But it seems to be an R 3.2.0 specific problem. On Sun, Jun 14, 2015 at 8:42 AM, David Winsemius dwinsem...@comcast.net wrote: On Jun 13, 2015, at 7:41 AM, Ramnik Bansal wrote: Getting following error in using help.search utils::help.search(linear models) Error in help(db[i