Re: [R] R help

2017-04-17 Thread Jeff Newmiller
I am assuming that you are referring to your emails from last October and last 
month regarding nlme.

A) Read the Posting Guide, which mentions things like the fact that you should 
set your email program to send plain text when posting on this mailing list , 
and that there is a dedicated R-sig-mixed-models mailing list where questions 
about nlme would be more on topic. (The plain text thing is important to avoid 
us receiving a corrupted version of what you sent, so it is important if we are 
to understand you.)

B) Don't reply to an existing message on the list with a completely different 
question... start a fresh email with an informative subject line and all of the 
replies will show up together in many email programs and in the archives. 
Hijacked email threads tend to get overlooked, which is not in your best 
interest. 

C) Make sure your example is reproducible. See for example [1] or [2] or [3] 
(or all three).

D) A course in linear regression should address when it is reasonable to remove 
terms, but it is beyond the scope of this list to go into that. Removing the 
intercept due to large p-values is hardly ever justified. Mixed models of the 
complexity you are trying to use typically require a lot more data than you 
showed last month to give significant results. You should probably consult with 
a local statistician on your experimental design.

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
[2] http://adv-r.had.co.nz/Reproducibility.html
[3] https://cran.r-project.org/web/packages/reprex/index.html

-- 
Sent from my phone. Please excuse my brevity.

On April 17, 2017 8:28:56 PM PDT, Santiago Bueno  wrote:
>I need help with R, and although I have posted my questions, no one
>seems
>to care. Can some one coach me in formulating a correct question?
>
>Regards,
>
>Santiago
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
Dear Boris,

Thank you for your reply.

> dput(count1_vector)
c(5, 6, 4, 4, 6, 5, 4, 5, 3, 7, 5, 5, 3, 4, 8, 6, 10, 2, 4, 6,
8, 4, 4, 6, 8, 5, 6, 3, 7, 9, 4, 7, 5, 7, 3, 4, 5, 2, 11, 7,
8, 5, 5, 6, 3, 2, 3, 5, 9, 6, 5, 6, 7, 3, 10, 7, 6, 4, 9, 5,
7, 3, 7, 3, 2, 3, 4, 5, 10, 4, 5, 5, 6, 7, 4, 8, 7, 5, 5, 4,
8, 7, 9, 4, 4, 4, 7, 5, 4, 10, 4, 5, 6, 1, 3, 5, 4, 7, 4, 6)

set.seed(123)
qqplot(count1_vector,rbinom(n=100,size=100,p=.05))
qqline(count1_vector,distribution = function(probs) { qbinom(probs,
size=100, prob=0.05) },
   col = "red",
   lwd = 0.5)

When I do this, the line does not pass through the center of my data.I do
expect count1_vector to be 100 samples of binomial with n=100 and p=.05.

Any comments or suggestions for me ?

Note : I built a 95% Confidence interval for my data and I counted how
often out of 100 times did the data fall outside the CI.This I expect to be
binomial with n=100,p=.05. I repeated this a 100 times and obtained
count1_vector.

Best Regards,
Ashim.


On Mon, Apr 17, 2017 at 7:51 PM, Boris Steipe 
wrote:

> That's not how qqline() works. The line is drawn with respect to a
> _reference_distribution_ which is the normal distribution by default. For
> the binomial distribution, you need to specify the distribution argument.
> There is an example in the help page that shows you how this is done for
> qchisq(). for qbinom() it is:
>
>
> set.seed(123)
> qqplot(rbinom(n=100, size=100, p=0.05),
>rbinom(n=100, size=100, p=0.05) )
>
> qqline(rbinom(n=100,size=100,p=.05),
>distribution = function(probs) { qbinom(probs, size=100, prob=0.05)
> },
>col = "red",
>lwd = 0.5)
>
>
>
>
> B.
>
>
> > On Apr 17, 2017, at 9:15 AM, Ashim Kapoor  wrote:
> >
> > Dear Spencer,
> >
> > Okay. Many thanks. My next query is how do I use qqline?
> >
> > When I try
> >
> >> qqline(rbinom(n=100,size=100,p=.05))
> >
> > I don't get the line in the right place.
> >
> > Best Regards,
> > Ashim
> >
> > On Mon, Apr 17, 2017 at 6:31 PM, Spencer Graves <
> > spencer.gra...@effectivedefense.org> wrote:
> >
> >>
> >>
> >> On 2017-04-17 7:58 AM, Ashim Kapoor wrote:
> >>
> >>> Dear All,
> >>>
> >>> set.seed(123)
> >>> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )
> >>>
> >>> I expect to see 1 clear line,but I don't. What am I misunderstanding?
> >>>
> >>
> >>
> >>  The distribution is discrete, and points are superimposed. Try the
> >> following:
> >>
> >>
> >> set.seed(123)
> >> qqplot(jitter(rbinom(n=100,size=100,p=.05)),
> >>   jitter(rbinom(n=100,size=100,p=.05) ))
> >>
> >>
> >>  Spencer Graves
> >>
> >>>
> >>> Best Regards,
> >>> Ashim
> >>>
> >>>[[alternative HTML version deleted]]
> >>>
> >>> __
> >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide http://www.R-project.org/posti
> >>> ng-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>>
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide http://www.R-project.org/posti
> >> ng-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] R help

2017-04-17 Thread David L Carlson
The only recent question that I can see you posted (Mar 22) was tagged onto an 
existing thread so it is possible people assumed you were answering the 
question raised by the original poster.

Do not use html - learn how to send emails as plain text.

If you have a question, start a new thread, do not add it as a reply to an 
existing question.

And the usual, post a reproducible example with data and code. Your last 
question did that. Try posting again, in plain text and creating a new subject 
line. Use dput() to send your data to the list. Just listing it with print can 
leave out important information.


David L. Carlson
Department of Anthropology
Texas A University


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Santiago Bueno
Sent: Monday, April 17, 2017 10:29 PM
To: R-help@r-project.org
Subject: [R] R help

I need help with R, and although I have posted my questions, no one seems
to care. Can some one coach me in formulating a correct question?

Regards,

Santiago

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Binning Data and Event rates

2017-04-17 Thread David L Carlson
After creating ppdat and ppdat$Valbin, aggregate() will get you the churn 
proportions:

> aggregate(Churn~Valbin, ppdat, mean)
   Valbin Churn
1 (20.9,43.7] 0.833
2 (43.7,66.3] 0.000
3 (66.3,89.1] 0.500


David L. Carlson
Department of Anthropology
Texas A University


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon
Sent: Monday, April 17, 2017 4:59 PM
To: prateek pande 
Cc: r-help mailing list 
Subject: Re: [R] Binning Data and Event rates

Hi Pateek,
Try this:
ppdat<-read.table(text="Values Churn
 21  1
 22  1
 31.2   1
 32  1
 35  0
 43  1
 45   0
 67  1
 67   0
 76   0
 89   1",
 header=TRUE)
ppdat$Valbin<-cut(ppdat$Values,breaks=c(20.9,43.7,66.3,89.1))
binPct<-function(x) return(100*sum(x)/length(x))
binnedPct<-by(ppdat$Churn,ppdat$Valbin,binPct)
bpctdf<-data.frame('Binned data'=names(binnedPct),
 'churn%'=as.vector(binnedPct))
bpctdf

Jim

On Tue, Apr 18, 2017 at 5:20 AM, prateek pande  wrote:
> I have a data, in the form mentioned below.
>
> Values Churn
> 21  1
> 22  1
> 31.2   1
> 32  1
> 35  0
> 43  1
> 45   0
> 67  1
> 67   0
> 76   0
> 89   1
>
> Now i want to bin the values variables into bins and corresponding that
> want the churn percentage, like mentioned below
>Binned data  churn%
>   (20.9,43.7]0.83
>   (43.7,66.3]0
>   (66.3,89.1]0.50
>
> Please help
>
> « Return to Rcom-l   |  3
> v
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Strip height in latticeExtra:::useOuterStrips

2017-04-17 Thread Ismail SEZEN

> On 18 Apr 2017, at 06:20, Duncan Mackay  wrote:
> 
> Hi all
> 
> I use latticeExtra::useOuterStrips quite a bit.
> The problem of strip height using useOuterStrips came up some time ago but
> did not have the time then to work something out so made do with the
> default layout.heights of strip = 1

?useOuterStrips gives the following function body:

useOuterStrips(x,
   strip = strip.default,
   strip.left = strip.custom(horizontal = FALSE),
   strip.lines = 1,
   strip.left.lines = strip.lines)

and set strip.lines = 4. Is this what you want?


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Strip height in latticeExtra:::useOuterStrips

2017-04-17 Thread Richard M. Heiberger
You had a typo.

library(latticeExtra)

Try this.  I am solving what I think is a problem related to yours.  I set it up
as a three-way plot instead of pasting two of the measures together.

## install.packages("HH") ## if necessary
library(HH)
tmp <- xyplot(x ~ d | a*b*c, data = df2,
   par.settings = list(layout.heights = list(strip = 2.2)))
useOuterStripsT2L1(tmp)

Rich

On Mon, Apr 17, 2017 at 11:20 PM, Duncan Mackay  wrote:
> Hi all
>
> I use latticeExtra::useOuterStrips quite a bit.
> The problem of strip height using useOuterStrips came up some time ago but
> did not have the time then to work something out so made do with the
> default layout.heights of strip = 1
>
> #Data:
>
> df2 <- structure(list(a = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
> 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L,
> 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("1", "2"), class = "factor"),
> b = structure(c(1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L,
> 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L,
> 2L, 2L, 1L, 1L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
> c = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L,
> 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L,
> 1L, 1L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
> d = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
> rep = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
> 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
> 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"),
> x = c(-0.626453810742333, 0.183643324222082, -0.835628612410047,
> 1.59528080213779, 0.329507771815361, -0.820468384118015,
> 0.487429052428485, 0.738324705129217, 0.575781351653492,
> -0.305388387156356, 1.51178116845085, 0.389843236411431,
> -0.621240580541804, -2.2146998871775, 1.12493091814311,
> -0.0449336090152308,
> -0.0161902630989461, 0.943836210685299, 0.821221195098089,
> 0.593901321217509, 0.918977371608218, 0.782136300731067,
> 0.0745649833651906, -1.98935169586337, 0.61982574789471,
> -0.0561287395290008, -0.155795506705329, -1.47075238389927,
> -0.47815005510862, 0.417941560199702, 1.35867955152904,
> -0.102787727342996
> )), .Names = c("a", "b", "c", "d", "rep", "x"), out.attrs =
> structure(list(
> dim = structure(c(2L, 2L, 2L, 2L, 2L), .Names = c("a", "b",
> "c", "d", "rep")), dimnames = structure(list(a = c("a=1",
> "a=2"), b = c("b=1", "b=2"), c = c("c=1", "c=2"), d = c("d=1",
> "d=2"), rep = c("rep=1", "rep=2")), .Names = c("a", "b",
> "c", "d", "rep"))), .Names = c("dim", "dimnames")), row.names = c(NA,
> -32L), class = "data.frame")
>
> str(df2)
>
> library(lattice)
> library(laticeExtra)
>
> # This is as per normal
> xyplot(x~d|paste(a,b)*c, data = df2)
>
> # Increase strip height to use atop later on for 2 lines of text/panel in
> strip
> # works OK
> xyplot(x~d|paste(a,b)*c, data = df2,
>par.settings = list(layout.heights = list(strip = 2.2)))
> # no change in strip height
> useOuterStrips(xyplot(x~d|paste(a,b)*c, data = df2,
>par.settings = list(layout.heights = list(strip = 2.2
>
> I have played around with various vector and list combinations for strip in
> layout.heights to no avail
> Does any one have an answer?
>
> Regards
>
> Duncan
>
> Duncan Mackay
> Department of Agronomy and Soil Science
> University of New England
> Armidale NSW 2351
> Email: home: mac...@northnet.com.au
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] R help

2017-04-17 Thread Santiago Bueno
I need help with R, and although I have posted my questions, no one seems
to care. Can some one coach me in formulating a correct question?

Regards,

Santiago

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Strip height in latticeExtra:::useOuterStrips

2017-04-17 Thread Duncan Mackay
Hi all

I use latticeExtra::useOuterStrips quite a bit.
The problem of strip height using useOuterStrips came up some time ago but
did not have the time then to work something out so made do with the
default layout.heights of strip = 1

#Data:

df2 <- structure(list(a = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 
1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 
1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("1", "2"), class = "factor"), 
b = structure(c(1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 
2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 
2L, 2L, 1L, 1L, 2L, 2L), .Label = c("1", "2"), class = "factor"), 
c = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 
1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 
1L, 1L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"), 
d = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"), 
rep = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1", "2"), class = "factor"), 
x = c(-0.626453810742333, 0.183643324222082, -0.835628612410047, 
1.59528080213779, 0.329507771815361, -0.820468384118015, 
0.487429052428485, 0.738324705129217, 0.575781351653492, 
-0.305388387156356, 1.51178116845085, 0.389843236411431, 
-0.621240580541804, -2.2146998871775, 1.12493091814311,
-0.0449336090152308, 
-0.0161902630989461, 0.943836210685299, 0.821221195098089, 
0.593901321217509, 0.918977371608218, 0.782136300731067, 
0.0745649833651906, -1.98935169586337, 0.61982574789471, 
-0.0561287395290008, -0.155795506705329, -1.47075238389927, 
-0.47815005510862, 0.417941560199702, 1.35867955152904,
-0.102787727342996
)), .Names = c("a", "b", "c", "d", "rep", "x"), out.attrs =
structure(list(
dim = structure(c(2L, 2L, 2L, 2L, 2L), .Names = c("a", "b", 
"c", "d", "rep")), dimnames = structure(list(a = c("a=1", 
"a=2"), b = c("b=1", "b=2"), c = c("c=1", "c=2"), d = c("d=1", 
"d=2"), rep = c("rep=1", "rep=2")), .Names = c("a", "b", 
"c", "d", "rep"))), .Names = c("dim", "dimnames")), row.names = c(NA, 
-32L), class = "data.frame")

str(df2)

library(lattice)
library(laticeExtra)

# This is as per normal
xyplot(x~d|paste(a,b)*c, data = df2)

# Increase strip height to use atop later on for 2 lines of text/panel in
strip
# works OK
xyplot(x~d|paste(a,b)*c, data = df2, 
   par.settings = list(layout.heights = list(strip = 2.2)))
# no change in strip height
useOuterStrips(xyplot(x~d|paste(a,b)*c, data = df2, 
   par.settings = list(layout.heights = list(strip = 2.2

I have played around with various vector and list combinations for strip in
layout.heights to no avail
Does any one have an answer?

Regards

Duncan

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mac...@northnet.com.au

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Difference between console output of cat and print

2017-04-17 Thread Bert Gunter
Well,...

cat() is as Jeff describes.

However, print() is a generic function (see ?UseMethod) for which
there are literally hundreds of different methods that may do far
more/different than merely output character strings. For example, the
print method for trellis objects, print.trellis, draws a graph of the
object.

The print method  called for print(10) is the default method, for
which ?print.default should be consulted: it is actually printing a
vector of length 1, and the print method for vectors labels each line
with the index of the first item printed.

Please read An Intro to R or other R tutorial to learn about S3 methods.

Cheers,
Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 3:01 PM, Jeff Newmiller
 wrote:
> Please stop posting html email per the Posting Guide. You are only going to 
> reduce the chance of successfully communicating your questions to experienced 
> users on this list.
>
> Re cat vs print: the purpose of print is to show values much as they are 
> entered in source code, so quotes and escaped characters such as "\n" are 
> shown. Cat is intended to provide a way to send characters straight to the 
> console so the effects of special characters can be visible (i.e. getting 
> text on the next line when a "\n" occurs in a string). Thus the element 
> numbering is not relevant there.
> --
> Sent from my phone. Please excuse my brevity.
>
> On April 17, 2017 12:18:36 AM PDT, Data MagicPro  
> wrote:
>>Since both *cat * as well as * print * create a character vector for
>>outputing on the screen. Still both give different results as apparant
>>below. My query is why so ?
>>
>>
>>> cat(10)
>>10
>>> print(10)
>>[1] 10
>>
>>Why is the [1] of index number missing in case of *cat *?
>>
>>Thanks
>>Ramnik
>>
>>   [[alternative HTML version deleted]]
>>
>>__
>>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>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.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

To _ALL_ who helped me.
In the final analysis, I was doing everything correctly, as per the 
manuals, the links, and the books I bought.
However, in all the material, it never read mention of creating of the 
.Rprofile file
with a programmer/developer text editor, which allows for no extension, 
no R, no txt.


You guys drilled down, and hit solid gold for me,
which lead to my understanding the issue, at least as I see it.

Pure GOLD Medal team work.
Again, I truly thank you.
Bruce

 


BR_email wrote:

TO _ALL_:
THANK YOU. THANK YOU. THANK YOU.
After hours, and hours, and hours, and ... , and hours: Success.
To all who helped, thanks.
My quest was minor, but major for me, as I learn from the path of one, 
whether big or small begets another.


I never look down at anyone, except to help him/her up.

With gratitude,
Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


Peter Dalgaard wrote:

On 17 Apr 2017, at 19:01 , BR_email  wrote:

Berend: Something looks good, but RStudio still Rprofile still doees 
not affect the launch.



source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
options(prompt="R> ")
set.seed(12345)
rm(list=ls())

R>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

Berend Hasselman wrote:

source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")
According to the gospel of St.Henrik, that filename is wrong, and 
possibly the directory too.


So try his suggestions. What is the output (show us!) of

normalizePath("./.Rprofile")
normalizePath("~/.Rprofile")

Assuming that the former is

"C:/Users/BruceRatner/Documents/.Rprofile"

you could try renaming the .Rprofile.site file to that. If need be, 
use file.rename, as in


file.rename(from="C:/Users/BruceRatner/Documents/.Rprofile.site", 
to="C:/Users/BruceRatner/Documents/.Rprofile")


(and restart, obviously).

[I wouldn't set the seed in a .Rprofile file, nor would I use rm() 
there, but that is a different kettle of fish.]






__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Difference between console output of cat and print

2017-04-17 Thread Jeff Newmiller
Please stop posting html email per the Posting Guide. You are only going to 
reduce the chance of successfully communicating your questions to experienced 
users on this list.

Re cat vs print: the purpose of print is to show values much as they are 
entered in source code, so quotes and escaped characters such as "\n" are 
shown. Cat is intended to provide a way to send characters straight to the 
console so the effects of special characters can be visible (i.e. getting text 
on the next line when a "\n" occurs in a string). Thus the element numbering is 
not relevant there.
-- 
Sent from my phone. Please excuse my brevity.

On April 17, 2017 12:18:36 AM PDT, Data MagicPro  
wrote:
>Since both *cat * as well as * print * create a character vector for
>outputing on the screen. Still both give different results as apparant
>below. My query is why so ?
>
>
>> cat(10)
>10
>> print(10)
>[1] 10
>
>Why is the [1] of index number missing in case of *cat *?
>
>Thanks
>Ramnik
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Binning Data and Event rates

2017-04-17 Thread Jim Lemon
Hi Pateek,
Try this:
ppdat<-read.table(text="Values Churn
 21  1
 22  1
 31.2   1
 32  1
 35  0
 43  1
 45   0
 67  1
 67   0
 76   0
 89   1",
 header=TRUE)
ppdat$Valbin<-cut(ppdat$Values,breaks=c(20.9,43.7,66.3,89.1))
binPct<-function(x) return(100*sum(x)/length(x))
binnedPct<-by(ppdat$Churn,ppdat$Valbin,binPct)
bpctdf<-data.frame('Binned data'=names(binnedPct),
 'churn%'=as.vector(binnedPct))
bpctdf

Jim

On Tue, Apr 18, 2017 at 5:20 AM, prateek pande  wrote:
> I have a data, in the form mentioned below.
>
> Values Churn
> 21  1
> 22  1
> 31.2   1
> 32  1
> 35  0
> 43  1
> 45   0
> 67  1
> 67   0
> 76   0
> 89   1
>
> Now i want to bin the values variables into bins and corresponding that
> want the churn percentage, like mentioned below
>Binned data  churn%
>   (20.9,43.7]0.83
>   (43.7,66.3]0
>   (66.3,89.1]0.50
>
> Please help
>
> « Return to Rcom-l   |  3
> v
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] Binning Data and Event rates

2017-04-17 Thread prateek pande
I have a data, in the form mentioned below.

Values Churn
21  1
22  1
31.2   1
32  1
35  0
43  1
45   0
67  1
67   0
76   0
89   1

Now i want to bin the values variables into bins and corresponding that
want the churn percentage, like mentioned below
   Binned data  churn%
  (20.9,43.7]0.83
  (43.7,66.3]0
  (66.3,89.1]0.50

Please help

« Return to Rcom-l   |  3
v

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Plot Arrows with Angle and length

2017-04-17 Thread Greg Snow
You can also look at the my.symbols and ms.arrows functions in the
TeachingDemos package.


On Wed, Mar 29, 2017 at 7:44 AM, julio cesar oliveira  wrote:
> Dears,
>
> The arrows command uses the start and end coordinates of each vector, but I
> have the starting coordinates, azimuth, and length.
>
> So, There are package that plot this arrows?
>
> Example:
>
>> x<- c(1,2,4)
>> y<- c(2,3,5)
>> Azimuth<- c(45,90,180)
>> Length<- c(1,0.5,1)
>
>
> Thanks,
>
> Julio
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



-- 
Gregory (Greg) L. Snow Ph.D.
538...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] ssa gapfill of series with large window and sparse gaps with Rssa

2017-04-17 Thread Bert Gunter
I should probably have added that you should have a look at R's time
series task view:

https://cran.r-project.org/web/views/TimeSeries.html

including anything there on irregular times series (e.g. irts() from
tseries package) and imputation.


Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 10:38 AM, Ateljevich, Eli@DWR
 wrote:
> I have several years of univariate wind speed data to which I would like to 
> apply singular spectrum analysis. The data are sampled every 15min and a year 
> is a fundamental periodicity, which suggests L=35,040 values.
>
>
> I would like to fill the gaps. The missing values are scattered at low 
> density throughout the series.  I doubt there is a block of even one month 
> that doesn't have at least a couple pieces of missing data, but I'd surprised 
> to learn the total number are prohibitive.
>
>
> The filling routines in Rssa like igapfill assume a shaped ssa object, so it 
> seems I need to run ssa successfully first before I can fill. When I try this 
> with L=35,040 or anything above about 2,000 I get an error message
> Nothing to decompose: the given field shape is empty
> and warnings like
> Some field elements were not covered by shaped window. 42646 elements will be 
> ommited.
>
>
> This is frustrating, because if I manually fill missing data with the series 
> mean, which I understand as being the first step of igapfill, the 
> decomposition succeeds with L=35040. The operation seems efficient and the 
> spectral components look as expected. But since I have manually created a 
> series with no missing data,  this doesn't help me with gap filling.
>
>
> To concoct a shaped ssa object with the original missing pattern, I invoked 
> force.decompose=FALSE. At that point I can bring my task to completion, but I 
> don't know what I'm doing.  The only examples I see in the docs are not 
> explained and are in 2D.
>
>
> Can someone familiar with this kind of use case explain what the purpose of 
> force.decompose and explain the best practice given my missing data 
> situation? Are there consequences to my workaround? Thanks.
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] ssa gapfill of series with large window and sparse gaps with Rssa

2017-04-17 Thread Bert Gunter
 ... "and explain the best practice given my missing data situation?"

I cannot speak to your other issues, but the above is definitely off
topic for this list, which is about R programming, not statistical
matters. Missing data are certainly a complex issue: you might try a
statistical list like stats.stackexchange.com for opinions on the
above.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 10:38 AM, Ateljevich, Eli@DWR
 wrote:
> I have several years of univariate wind speed data to which I would like to 
> apply singular spectrum analysis. The data are sampled every 15min and a year 
> is a fundamental periodicity, which suggests L=35,040 values.
>
>
> I would like to fill the gaps. The missing values are scattered at low 
> density throughout the series.  I doubt there is a block of even one month 
> that doesn't have at least a couple pieces of missing data, but I'd surprised 
> to learn the total number are prohibitive.
>
>
> The filling routines in Rssa like igapfill assume a shaped ssa object, so it 
> seems I need to run ssa successfully first before I can fill. When I try this 
> with L=35,040 or anything above about 2,000 I get an error message
> Nothing to decompose: the given field shape is empty
> and warnings like
> Some field elements were not covered by shaped window. 42646 elements will be 
> ommited.
>
>
> This is frustrating, because if I manually fill missing data with the series 
> mean, which I understand as being the first step of igapfill, the 
> decomposition succeeds with L=35040. The operation seems efficient and the 
> spectral components look as expected. But since I have manually created a 
> series with no missing data,  this doesn't help me with gap filling.
>
>
> To concoct a shaped ssa object with the original missing pattern, I invoked 
> force.decompose=FALSE. At that point I can bring my task to completion, but I 
> don't know what I'm doing.  The only examples I see in the docs are not 
> explained and are in 2D.
>
>
> Can someone familiar with this kind of use case explain what the purpose of 
> force.decompose and explain the best practice given my missing data 
> situation? Are there consequences to my workaround? Thanks.
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


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

2017-04-17 Thread William Dunlap via R-help
A long time ago (before the mid-1990's?) with S or S+
   ff <- function(n){ for(i in 1:n) (i+1)
   op <- ff(3)
would result in 'op' being 4, since a for-loop's value
was the value of the last expression executed in the
body of the loop.  The presence of a 'next' or 'break'
in the loop body would affect the return value.

This made the primitive garbage collection used the time
not work so well and was one reason that for-loops with
lots of iterations ran slowly.  Almost no one used
the return value of a for-loop so, to avoid memory issues,
for was changed to always return NULL.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Sun, Apr 16, 2017 at 7:26 PM, Ramnik Bansal  wrote:
> 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) }*
>
> Then
> *n<-3;ff(n)->op;rm(n);print(op)*
> gives 4 as output.
>
> My question is *Which *is considered as the last line in a functoin for the
> purpsoe of default return ? And under what conditions ?
>
> -Thanks,
> Ramnik
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

TO _ALL_:
THANK YOU. THANK YOU. THANK YOU.
After hours, and hours, and hours, and ... , and hours: Success.
To all who helped, thanks.
My quest was minor, but major for me, as I learn from the path of one, 
whether big or small begets another.


I never look down at anyone, except to help him/her up.

With gratitude,
Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


Peter Dalgaard wrote:

On 17 Apr 2017, at 19:01 , BR_email  wrote:

Berend: Something looks good, but RStudio still Rprofile still doees not affect 
the launch.


source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
options(prompt="R> ")
set.seed(12345)
rm(list=ls())

R>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

Berend Hasselman wrote:

source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")

According to the gospel of St.Henrik, that filename is wrong, and possibly the 
directory too.

So try his suggestions. What is the output (show us!) of

normalizePath("./.Rprofile")
normalizePath("~/.Rprofile")

Assuming that the former is

"C:/Users/BruceRatner/Documents/.Rprofile"

you could try renaming the .Rprofile.site file to that. If need be, use 
file.rename, as in

file.rename(from="C:/Users/BruceRatner/Documents/.Rprofile.site", 
to="C:/Users/BruceRatner/Documents/.Rprofile")

(and restart, obviously).

[I wouldn't set the seed in a .Rprofile file, nor would I use rm() there, but 
that is a different kettle of fish.]



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] ssa gapfill of series with large window and sparse gaps with Rssa

2017-04-17 Thread Ateljevich, Eli@DWR
I have several years of univariate wind speed data to which I would like to 
apply singular spectrum analysis. The data are sampled every 15min and a year 
is a fundamental periodicity, which suggests L=35,040 values.


I would like to fill the gaps. The missing values are scattered at low density 
throughout the series.  I doubt there is a block of even one month that doesn't 
have at least a couple pieces of missing data, but I'd surprised to learn the 
total number are prohibitive.


The filling routines in Rssa like igapfill assume a shaped ssa object, so it 
seems I need to run ssa successfully first before I can fill. When I try this 
with L=35,040 or anything above about 2,000 I get an error message
Nothing to decompose: the given field shape is empty
and warnings like
Some field elements were not covered by shaped window. 42646 elements will be 
ommited.


This is frustrating, because if I manually fill missing data with the series 
mean, which I understand as being the first step of igapfill, the decomposition 
succeeds with L=35040. The operation seems efficient and the spectral 
components look as expected. But since I have manually created a series with no 
missing data,  this doesn't help me with gap filling.


To concoct a shaped ssa object with the original missing pattern, I invoked 
force.decompose=FALSE. At that point I can bring my task to completion, but I 
don't know what I'm doing.  The only examples I see in the docs are not 
explained and are in 2D.


Can someone familiar with this kind of use case explain what the purpose of 
force.decompose and explain the best practice given my missing data situation? 
Are there consequences to my workaround? Thanks.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Peter Dalgaard

> On 17 Apr 2017, at 19:01 , BR_email  wrote:
> 
> Berend: Something looks good, but RStudio still Rprofile still doees not 
> affect the launch.
> 
>> source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
>> options(prompt="R> ")
> 
>> set.seed(12345)
> 
>> rm(list=ls())
> 
> R>
> 
> 
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
> 
> Berend Hasselman wrote:
>> source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")
> 

According to the gospel of St.Henrik, that filename is wrong, and possibly the 
directory too.

So try his suggestions. What is the output (show us!) of

normalizePath("./.Rprofile")
normalizePath("~/.Rprofile")

Assuming that the former is 

"C:/Users/BruceRatner/Documents/.Rprofile"

you could try renaming the .Rprofile.site file to that. If need be, use 
file.rename, as in

file.rename(from="C:/Users/BruceRatner/Documents/.Rprofile.site", 
to="C:/Users/BruceRatner/Documents/.Rprofile")

(and restart, obviously).

[I wouldn't set the seed in a .Rprofile file, nor would I use rm() there, but 
that is a different kettle of fish.]

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Jeff Newmiller
".Rprofile.site" is not looked for in "C:/Users/BruceRatner/Documents/". That 
file belongs in the R.home("etc") directory.  I suggest you stay away from the 
system wide configuration and focus on your personal configuration file 
""C:/Users/BruceRatner/Documents/.Rprofile".

I also recommend putting the arguments in the order given in ?source unless you 
name every single argument.
-- 
Sent from my phone. Please excuse my brevity.

On April 17, 2017 9:39:50 AM PDT, BR_email  wrote:
>Bill, part II:
>
>>source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site") 
>Error: unexpected symbol in "source(echo=TRUE, ""C"
>
> >
>
>
>Bruce Ratner, Ph.D.
>The Significant Statistician™
>(516) 791-3544
>Statistical Predictive Analtyics -- www.DMSTAT1.com
>Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>  
>
>BR_email wrote:
>> Bill:
>> Success, almost there:
>>
>>>
>writeLines(readLines("C:/Users/BruceRatner/Documents/.Rprofile.site")) 
>>> options(prompt="R> ")
>> set.seed(12345)
>> rm(list=ls())
>>
>> >
>>
>>
>> Yet, still not affecting the launch, as "R>" is not there.
>> Any suggestions, please. "So close, yet far away, ... " - Carly Simon
>>
>>
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>
>>
>> William Dunlap wrote:
>>> No calls please.  Just show the group what .../etc/Rprofile-site 
>>> contained.
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>>
>>>
>>> On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:
 Bill:
 I feel you are nailing it for me.
 Can I please call you, but I am getting a little lost, and losing
>your
 valuable help?
 Bruce


 Bruce Ratner, Ph.D.
 The Significant Statistician™
 (516) 791-3544
 Statistical Predictive Analtyics -- www.DMSTAT1.com
 Machine-Learning Data Mining and Modeling -- www.GenIQ.net

 William Dunlap wrote:
> I should haved added full.names=TRUE to the dir() call.  I you add
> that I'd expect that you would see ".../etc/Rprofile.site". What
>do
> you see when you do
>
>writeLines(readLines(".../etc/Rprofile.site")
>
> and
>source(echo=TRUE, ".../etc/Rprofile.site")
>
> (replace the ellipsis by whatever dir(full.names=TRUE,...)
>showed).
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:
>> Bill:
>> Here's what I got:
>>
>> dir(c(".", Sys.getenv("HOME"), R.home("etc")),
>pattern="Rprofile") 
>> [1]
>> "Rprofile.site"
>>
>>
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>
>>
>> William Dunlap wrote:
>>> Use the R command
>>>  dir(c(".", Sys.getenv("HOME"), R.home("etc")), 
>>> pattern="Rprofile")
>>> to see if there are any file names with the unwanted ".txt" and
>use
>>> file.rename() to fix them up.
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>>
>>>
>>> On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap
>
>>> wrote:
 I believe someone already mentioned it, but notepad makes it 
 hard to
 save a file without the ".txt" extension to its name. R does
>not do
 anything with .Rprofile.txt, only .Rprofile, so you must figure
>
 out a
 way to work around notepad's mangling of the file name.
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com


 On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD
>
 wrote:
> Bert:
> I used note pad under Administrator. The code:
> options(prompt="R> ")
> set.seed(12345)
>
> Bruce
>
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
>> 
>> wrote:
>>
>> I cannot add to the instructions that you have already been
>given
>> regarding .Rprofile.
>>
>> But what code did you use in your .Rprofile to set the
>prompt? 
>> The
>> posting guide explicitly requests that you provide your code,
>> although
>> maybe you already did earlier in this extensive thread.
>>
>> ?options
>>
>> is how it can be set. Did you do this?
>>
>> -- Bert
>>
>> Bert Gunter

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email
Berend: Something looks good, but RStudio still Rprofile still doees not 
affect the launch.



source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
options(prompt="R> ")



set.seed(12345)



rm(list=ls())


R>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


Berend Hasselman wrote:

source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Berend Hasselman

> On 17 Apr 2017, at 18:39, BR_email  wrote:
> 
> Bill, part II:
> 
>> source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site") 
> Error: unexpected symbol in "source(echo=TRUE, ""C"
> 

You have a double quote sign ("") preceding C:/.
Make it a single double quote so that you get "C:/"

Berend

> >
> 
> 
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
> 
> BR_email wrote:
>> Bill:
>> Success, almost there:
>> 
>>> writeLines(readLines("C:/Users/BruceRatner/Documents/.Rprofile.site")) 
>>> options(prompt="R> ")
>> set.seed(12345)
>> rm(list=ls())
>> 
>> >
>> 
>> 
>> Yet, still not affecting the launch, as "R>" is not there.
>> Any suggestions, please. "So close, yet far away, ... " - Carly Simon
>> 
>> 
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>> 
>> 
>> William Dunlap wrote:
>>> No calls please.  Just show the group what .../etc/Rprofile-site contained.
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>> 
>>> 
>>> On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:
 Bill:
 I feel you are nailing it for me.
 Can I please call you, but I am getting a little lost, and losing your
 valuable help?
 Bruce
 
 
 Bruce Ratner, Ph.D.
 The Significant Statistician™
 (516) 791-3544
 Statistical Predictive Analtyics -- www.DMSTAT1.com
 Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 
 William Dunlap wrote:
> I should haved added full.names=TRUE to the dir() call.  I you add
> that I'd expect that you would see ".../etc/Rprofile.site". What do
> you see when you do
> 
>   writeLines(readLines(".../etc/Rprofile.site")
> 
> and
>   source(echo=TRUE, ".../etc/Rprofile.site")
> 
> (replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
> 
> 
> On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:
>> Bill:
>> Here's what I got:
>> 
>> dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
>> "Rprofile.site"
>> 
>> 
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>> 
>> 
>> William Dunlap wrote:
>>> Use the R command
>>> dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
>>> to see if there are any file names with the unwanted ".txt" and use
>>> file.rename() to fix them up.
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>> 
>>> 
>>> On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap 
>>> wrote:
 I believe someone already mentioned it, but notepad makes it hard to
 save a file without the ".txt" extension to its name. R does not do
 anything with .Rprofile.txt, only .Rprofile, so you must figure out a
 way to work around notepad's mangling of the file name.
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com
 
 
 On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
 wrote:
> Bert:
> I used note pad under Administrator. The code:
> options(prompt="R> ")
> set.seed(12345)
> 
> Bruce
> 
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
> 
> 
> 
>> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
>> wrote:
>> 
>> I cannot add to the instructions that you have already been given
>> regarding .Rprofile.
>> 
>> But what code did you use in your .Rprofile to set the prompt? The
>> posting guide explicitly requests that you provide your code,
>> although
>> maybe you already did earlier in this extensive thread.
>> 
>> ?options
>> 
>> is how it can be set. Did you do this?
>> 
>> -- Bert
>> 
>> Bert Gunter
>> 
>> "The trouble with having an open mind is that people keep coming
>> along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>> 
>> 
>>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
>>> wrote:
>>> 

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Bill, part II:

source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site") 

Error: unexpected symbol in "source(echo=TRUE, ""C"

>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


BR_email wrote:

Bill:
Success, almost there:

writeLines(readLines("C:/Users/BruceRatner/Documents/.Rprofile.site")) 
options(prompt="R> ")

set.seed(12345)
rm(list=ls())

>


Yet, still not affecting the launch, as "R>" is not there.
Any suggestions, please. "So close, yet far away, ... " - Carly Simon


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


William Dunlap wrote:
No calls please.  Just show the group what .../etc/Rprofile-site 
contained.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:

Bill:
I feel you are nailing it for me.
Can I please call you, but I am getting a little lost, and losing your
valuable help?
Bruce


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

William Dunlap wrote:

I should haved added full.names=TRUE to the dir() call.  I you add
that I'd expect that you would see ".../etc/Rprofile.site". What do
you see when you do

   writeLines(readLines(".../etc/Rprofile.site")

and
   source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:

Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") 
[1]

"Rprofile.site"


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


William Dunlap wrote:

Use the R command
 dir(c(".", Sys.getenv("HOME"), R.home("etc")), 
pattern="Rprofile")

to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap 
wrote:
I believe someone already mentioned it, but notepad makes it 
hard to

save a file without the ".txt" extension to its name. R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure 
out a

way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net



On Apr 17, 2017, at 10:30 AM, Bert Gunter 


wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? 
The

posting guide explicitly requests that you provide your code,
although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming
along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic 
strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 


wrote:
David:
When I launch Rstudio the effects of the Rprofile do not 
show, e.g.,

I
want the prompt to be "R> " instead of the default "> ". The 
former

doesn't
show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius

wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.












__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Bill:
Success, almost there:


writeLines(readLines("C:/Users/BruceRatner/Documents/.Rprofile.site")) 
options(prompt="R> ")

set.seed(12345)
rm(list=ls())

>


Yet, still not affecting the launch, as "R>" is not there.
Any suggestions, please. "So close, yet far away, ... " - Carly Simon


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


William Dunlap wrote:

No calls please.  Just show the group what .../etc/Rprofile-site contained.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:

Bill:
I feel you are nailing it for me.
Can I please call you, but I am getting a little lost, and losing your
valuable help?
Bruce


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

William Dunlap wrote:

I should haved added full.names=TRUE to the dir() call.  I you add
that I'd expect that you would see ".../etc/Rprofile.site".  What do
you see when you do

   writeLines(readLines(".../etc/Rprofile.site")

and
   source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:

Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
"Rprofile.site"


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


William Dunlap wrote:

Use the R command
 dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap 
wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter 
wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code,
although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming
along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g.,
I
want the prompt to be "R> " instead of the default "> ". The former
doesn't
show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius

wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.










__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Sorry for the phone suggestion.
Bill, I do not know what type of editor to use, can you suggest?
BR

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


William Dunlap wrote:

No calls please.  Just show the group what .../etc/Rprofile-site contained.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:

Bill:
I feel you are nailing it for me.
Can I please call you, but I am getting a little lost, and losing your
valuable help?
Bruce


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

William Dunlap wrote:

I should haved added full.names=TRUE to the dir() call.  I you add
that I'd expect that you would see ".../etc/Rprofile.site".  What do
you see when you do

   writeLines(readLines(".../etc/Rprofile.site")

and
   source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:

Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
"Rprofile.site"


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


William Dunlap wrote:

Use the R command
 dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap 
wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter 
wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code,
although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming
along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g.,
I
want the prompt to be "R> " instead of the default "> ". The former
doesn't
show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius

wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.










__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
No calls please.  Just show the group what .../etc/Rprofile-site contained.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:36 AM, BR_email  wrote:
> Bill:
> I feel you are nailing it for me.
> Can I please call you, but I am getting a little lost, and losing your
> valuable help?
> Bruce
>
>
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>
> William Dunlap wrote:
>>
>> I should haved added full.names=TRUE to the dir() call.  I you add
>> that I'd expect that you would see ".../etc/Rprofile.site".  What do
>> you see when you do
>>
>>   writeLines(readLines(".../etc/Rprofile.site")
>>
>> and
>>   source(echo=TRUE, ".../etc/Rprofile.site")
>>
>> (replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>>
>> On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:
>>>
>>> Bill:
>>> Here's what I got:
>>>
>>> dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
>>> "Rprofile.site"
>>>
>>>
>>> Bruce Ratner, Ph.D.
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>>
>>>
>>> William Dunlap wrote:

 Use the R command
 dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
 to see if there are any file names with the unwanted ".txt" and use
 file.rename() to fix them up.
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com


 On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap 
 wrote:
>
> I believe someone already mentioned it, but notepad makes it hard to
> save a file without the ".txt" extension to its name.  R does not do
> anything with .Rprofile.txt, only .Rprofile, so you must figure out a
> way to work around notepad's mangling of the file name.
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
> wrote:
>>
>> Bert:
>> I used note pad under Administrator. The code:
>> options(prompt="R> ")
>> set.seed(12345)
>>
>> Bruce
>>
>> __
>> Bruce Ratner PhD
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analytics -- www.DMSTAT1.com
>> Machine-Learning Data Mining -- www.GenIQ.net
>>
>>
>>
>>> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
>>> wrote:
>>>
>>> I cannot add to the instructions that you have already been given
>>> regarding .Rprofile.
>>>
>>> But what code did you use in your .Rprofile to set the prompt? The
>>> posting guide explicitly requests that you provide your code,
>>> although
>>> maybe you already did earlier in this extensive thread.
>>>
>>> ?options
>>>
>>> is how it can be set. Did you do this?
>>>
>>> -- Bert
>>>
>>> Bert Gunter
>>>
>>> "The trouble with having an open mind is that people keep coming
>>> along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>>
>>>
 On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
 wrote:
 David:
 When I launch Rstudio the effects of the Rprofile do not show, e.g.,
 I
 want the prompt to be "R> " instead of the default "> ". The former
 doesn't
 show.
 Bruce

 __
 Bruce Ratner PhD
 The Significant Statistician™
 (516) 791-3544
 Statistical Predictive Analytics -- www.DMSTAT1.com
 Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 16, 2017, at 7:34 PM, David Winsemius
> 
> wrote:
>
>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.



>>
>>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Simulating survival data with co-variate interactions

2017-04-17 Thread Bert Gunter
This appears to fall into the realm of statistical questions, which
are mainly off topic for this list, which is about R programming
questions (subsequent posts here *may* be appropriate after you have
resolved the statistical questions). You might try posting on a
statistical list like stats.stackexchange.com.  Note: You will likely
have to provide far greater detail to get helpful replies, though they
may be able to refer you to approriate resources, e.g. texts.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 3:36 AM, Justine Nasejje
 wrote:
> Dear list members,
>  Can you please share your knowledge with me on how to simulate
> survival data with covariate interactions? Your help will be highly
> appreciated.
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R-es] Matriz como producto de vectores.

2017-04-17 Thread Carlos J. Gil Bellosta
a <- 1:4
b <- 3:6
a %*% t(b)


El 17 de abril de 2017, 17:26, Horacio  escribió:

> Buenas tengo una matriz de contingencia de 5x4 donde en la última fila
> y última columna tengo las frecuencias marginales, en función de estas
> quiero sacar las esperadas, pero cuando hago por ejemplo el producto,,
>
> Esperadas<-Estrategia["Suma",]*Estrategia[,"Suma_e"]
>E1E2E3E4  Suma
>  5550 14160 52650 89600 20720
> Warning message:
> In Estrategia["Suma", ] * Estrategia[, "Suma_e"] :
>   longitud de objeto mayor no es múltiplo de la longitud de uno menor
>
> me da un vector y no una matriz,,, como puedo hacer esto? no sé si se
> entiende lo que busco
>
> Gracias,,,
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Bill:
I feel you are nailing it for me.
Can I please call you, but I am getting a little lost, and losing your 
valuable help?

Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


William Dunlap wrote:

I should haved added full.names=TRUE to the dir() call.  I you add
that I'd expect that you would see ".../etc/Rprofile.site".  What do
you see when you do

  writeLines(readLines(".../etc/Rprofile.site")

and
  source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:

Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
"Rprofile.site"


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net


William Dunlap wrote:

Use the R command
dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap  wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter 
wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I
want the prompt to be "R> " instead of the default "> ". The former doesn't
show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius 
wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.








__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
Use another editor or go to file explorer, turn on the 'show file
extensions' option and rename the file so it does not have the .R
extension.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:26 AM, BR_email  wrote:
> I used not extension, but R extension shows up.
>
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>
> William Dunlap wrote:
>>
>> Not file exention ".R" - no file exention at all.
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>>
>> On Mon, Apr 17, 2017 at 8:13 AM, BR_email  wrote:
>>>
>>> Bill:
>>> I did workaround. I created the Rprofile files with file type R, not txt.
>>> Bruce
>>>
>>>
>>>
>>> William Dunlap wrote:

 I believe someone already mentioned it, but notepad makes it hard to
 save a file without the ".txt" extension to its name.  R does not do
 anything with .Rprofile.txt, only .Rprofile, so you must figure out a
 way to work around notepad's mangling of the file name.
 Bill Dunlap
 TIBCO Software
 wdunlap tibco.com


 On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD 
 wrote:
>
> Bert:
> I used note pad under Administrator. The code:
> options(prompt="R> ")
> set.seed(12345)
>
> Bruce
>
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
>> wrote:
>>
>> I cannot add to the instructions that you have already been given
>> regarding .Rprofile.
>>
>> But what code did you use in your .Rprofile to set the prompt? The
>> posting guide explicitly requests that you provide your code, although
>> maybe you already did earlier in this extensive thread.
>>
>> ?options
>>
>> is how it can be set. Did you do this?
>>
>> -- Bert
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
>>> wrote:
>>> David:
>>> When I launch Rstudio the effects of the Rprofile do not show, e.g.,
>>> I
>>> want the prompt to be "R> " instead of the default "> ". The former
>>> doesn't
>>> show.
>>> Bruce
>>>
>>> __
>>> Bruce Ratner PhD
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analytics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining -- www.GenIQ.net
>>>
>>>
>>>
 On Apr 16, 2017, at 7:34 PM, David Winsemius
 
 wrote:


> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



>>
>>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
I should haved added full.names=TRUE to the dir() call.  I you add
that I'd expect that you would see ".../etc/Rprofile.site".  What do
you see when you do

 writeLines(readLines(".../etc/Rprofile.site")

and
 source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:24 AM, BR_email  wrote:
> Bill:
> Here's what I got:
>
> dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1]
> "Rprofile.site"
>
>
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>
>
> William Dunlap wrote:
>>
>> Use the R command
>>dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
>> to see if there are any file names with the unwanted ".txt" and use
>> file.rename() to fix them up.
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>>
>> On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap  wrote:
>>>
>>> I believe someone already mentioned it, but notepad makes it hard to
>>> save a file without the ".txt" extension to its name.  R does not do
>>> anything with .Rprofile.txt, only .Rprofile, so you must figure out a
>>> way to work around notepad's mangling of the file name.
>>> Bill Dunlap
>>> TIBCO Software
>>> wdunlap tibco.com
>>>
>>>
>>> On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:

 Bert:
 I used note pad under Administrator. The code:
 options(prompt="R> ")
 set.seed(12345)

 Bruce

 __
 Bruce Ratner PhD
 The Significant Statistician™
 (516) 791-3544
 Statistical Predictive Analytics -- www.DMSTAT1.com
 Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
> wrote:
>
> I cannot add to the instructions that you have already been given
> regarding .Rprofile.
>
> But what code did you use in your .Rprofile to set the prompt? The
> posting guide explicitly requests that you provide your code, although
> maybe you already did earlier in this extensive thread.
>
> ?options
>
> is how it can be set. Did you do this?
>
> -- Bert
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
>> wrote:
>> David:
>> When I launch Rstudio the effects of the Rprofile do not show, e.g., I
>> want the prompt to be "R> " instead of the default "> ". The former 
>> doesn't
>> show.
>> Bruce
>>
>> __
>> Bruce Ratner PhD
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analytics -- www.DMSTAT1.com
>> Machine-Learning Data Mining -- www.GenIQ.net
>>
>>
>>
>>> On Apr 16, 2017, at 7:34 PM, David Winsemius 
>>> wrote:
>>>
>>>
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.
>>
>>
>>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

I used not extension, but R extension shows up.

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


William Dunlap wrote:

Not file exention ".R" - no file exention at all.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:13 AM, BR_email  wrote:

Bill:
I did workaround. I created the Rprofile files with file type R, not txt.
Bruce



William Dunlap wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter 
wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I
want the prompt to be "R> " instead of the default "> ". The former doesn't
show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius 
wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.








__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1] 
"Rprofile.site"


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


William Dunlap wrote:

Use the R command
   dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap  wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter  wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I want the prompt to be "R> 
" instead of the default "> ". The former doesn't show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius  wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] Simulating survival data with co-variate interactions

2017-04-17 Thread Justine Nasejje
Dear list members,
 Can you please share your knowledge with me on how to simulate
survival data with covariate interactions? Your help will be highly
appreciated.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Difference between console output of cat and print

2017-04-17 Thread Data MagicPro
Since both *cat * as well as * print * create a character vector for
outputing on the screen. Still both give different results as apparant
below. My query is why so ?


> cat(10)
10
> print(10)
[1] 10

Why is the [1] of index number missing in case of *cat *?

Thanks
Ramnik

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

I did it both ways, with and without: no success.

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net
 


Jeff Newmiller wrote:

Doing anything as Administrator means you are probably already in file 
permissions hell. R works great if you avoid Administrator mode entirely... 
using it raises the complexity of every step you take drastically.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
Not file exention ".R" - no file exention at all.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:13 AM, BR_email  wrote:
> Bill:
> I did workaround. I created the Rprofile files with file type R, not txt.
> Bruce
>
>
>
> William Dunlap wrote:
>>
>> I believe someone already mentioned it, but notepad makes it hard to
>> save a file without the ".txt" extension to its name.  R does not do
>> anything with .Rprofile.txt, only .Rprofile, so you must figure out a
>> way to work around notepad's mangling of the file name.
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>>
>> On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:
>>>
>>> Bert:
>>> I used note pad under Administrator. The code:
>>> options(prompt="R> ")
>>> set.seed(12345)
>>>
>>> Bruce
>>>
>>> __
>>> Bruce Ratner PhD
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analytics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining -- www.GenIQ.net
>>>
>>>
>>>
 On Apr 17, 2017, at 10:30 AM, Bert Gunter 
 wrote:

 I cannot add to the instructions that you have already been given
 regarding .Rprofile.

 But what code did you use in your .Rprofile to set the prompt? The
 posting guide explicitly requests that you provide your code, although
 maybe you already did earlier in this extensive thread.

 ?options

 is how it can be set. Did you do this?

 -- Bert

 Bert Gunter

 "The trouble with having an open mind is that people keep coming along
 and sticking things into it."
 -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
> wrote:
> David:
> When I launch Rstudio the effects of the Rprofile do not show, e.g., I
> want the prompt to be "R> " instead of the default "> ". The former 
> doesn't
> show.
> Bruce
>
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 16, 2017, at 7:34 PM, David Winsemius 
>> wrote:
>>
>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>>
>>
>>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
Use the R command
  dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 8:06 AM, William Dunlap  wrote:
> I believe someone already mentioned it, but notepad makes it hard to
> save a file without the ".txt" extension to its name.  R does not do
> anything with .Rprofile.txt, only .Rprofile, so you must figure out a
> way to work around notepad's mangling of the file name.
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:
>> Bert:
>> I used note pad under Administrator. The code:
>> options(prompt="R> ")
>> set.seed(12345)
>>
>> Bruce
>>
>> __
>> Bruce Ratner PhD
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analytics -- www.DMSTAT1.com
>> Machine-Learning Data Mining -- www.GenIQ.net
>>
>>
>>
>>> On Apr 17, 2017, at 10:30 AM, Bert Gunter  wrote:
>>>
>>> I cannot add to the instructions that you have already been given
>>> regarding .Rprofile.
>>>
>>> But what code did you use in your .Rprofile to set the prompt? The
>>> posting guide explicitly requests that you provide your code, although
>>> maybe you already did earlier in this extensive thread.
>>>
>>> ?options
>>>
>>> is how it can be set. Did you do this?
>>>
>>> -- Bert
>>>
>>> Bert Gunter
>>>
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>>
>>>
 On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
 David:
 When I launch Rstudio the effects of the Rprofile do not show, e.g., I 
 want the prompt to be "R> " instead of the default "> ". The former 
 doesn't show.
 Bruce

 __
 Bruce Ratner PhD
 The Significant Statistician™
 (516) 791-3544
 Statistical Predictive Analytics -- www.DMSTAT1.com
 Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 16, 2017, at 7:34 PM, David Winsemius  
> wrote:
>
>
>>>
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Henrik:
The Rprofile file is there, I see it.

Bruce Ratner, Ph.D.

 


Henrik Bengtsson wrote:
Did you try any of the troubleshooting I suggested? If you do that, 
I'm 99.99% certain it'll help you to resolve this.


Henrik


On Apr 17, 2017 03:07, "Bruce Ratner PhD" > wrote:


David:
When I launch Rstudio the effects of the Rprofile do not show,
e.g., I want the prompt to be "R> " instead of the default "> ".
The former doesn't show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544 
Statistical Predictive Analytics -- www.DMSTAT1.com

Machine-Learning Data Mining -- www.GenIQ.net 



> On Apr 16, 2017, at 7:34 PM, David Winsemius
> wrote:
>
>
>> On Apr 16, 2017, at 3:43 PM, BR_email > wrote:
>>
>> Peter:
>> Thanks for reply and suggestion.
>> Sorry, I am not sure how to assess.
>> The doc is too technical for me to understand.
>> I found multiple instructions online and in R and RStudio books.
>> I'm doing what it says, but no success.
>
> What is "it" and what is "lack of success"?
>
>> The instructions are simple as a-b-c, but some setting within
the Windows system must be the culprit.
>
> Although the RStudio page immediately below was done with a Mac,
I suspect there are similar selection panels and dialogs on the
Windows version of RStudio.
>
> https://support.rstudio.com/hc/en-us/articles/200549016#general

>
> When I look at the Windows installation advice I see near the
top: "When installing on a 64-bit version of Windows the options
will include 32- or 64-bit versions of R (and the default is to
install both)." So is it possible that RStudio is looking at a
different version of R than you believe it should be, perhaps at
the 32 bit R versus the 64 bit one? The result at the beginning of
this thread makes me think you got the 32-bit one connected to
RStudio.
>
> And I say again: I believe problems in configuring RStudio are
off-topic for Rhelp and you should have been searching or posting
question either to the RStudio support or StackOverflow. Looking
at the responses to the queries above and the ones found below, it
appears to me that there are RStudio-specific issues that go
beyond what is in the `help(Startup)` or equivalent
`help(.Rprofile)` page. I gave an instance of an SO search
upthread and I offer another SO search:
>
>

http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20environment%20variables%20windows


>
> I thought that this one below had potentially useful
information, but I am not a Windows user (and you have not shown
an inclination in offering a complete description of your efforts
at following that advice. At any rate it would have been more
appropriate to respond to the SO answers that were ineffective or
to post a question there with full description of your efforts and
content of your .Rprofile file and your current environment
variable settings.)
>
>

http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20rprofile%20windows


>
> --
> David
>
>>
>> Regards,
>> Bruce
>>
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544 
>> Statistical Predictive Analtyics -- www.DMSTAT1.com

>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net

>>
>> peter dalgaard wrote:
>>> Um, tried help(.Rprofile) lately?
>>>
>>> -pd
>>>
 On 17 Apr 2017, at 00:08 , Rolf Turner
> wrote:


> On 17/04/17 08:46, John C Frain wrote:
>
> Bruce
>
> The official documentation for these startup files can be
obtained with
> the command
>
> Help(Startup)

 Minor point of order, Mr. Chairman. That should be:

   help(Startup)

 There is (as far as I know) no such function as "Help()".  It
is important to remember that R is case sensitive.

 Another point that is worthy of thought is "How in God's name
would any beginner know or find out about the usage
help(Startup)?"  Unless they were explicitly told about it, in the
manner which 

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Jeff Newmiller
Doing anything as Administrator means you are probably already in file 
permissions hell. R works great if you avoid Administrator mode entirely... 
using it raises the complexity of every step you take drastically.
-- 
Sent from my phone. Please excuse my brevity.

On April 17, 2017 7:41:18 AM PDT, Bruce Ratner PhD  wrote:
>Bert:
>I used note pad under Administrator. The code:
>options(prompt="R> ")
>set.seed(12345)
>
>Bruce
>
>__
>Bruce Ratner PhD
>The Significant Statistician™
>(516) 791-3544
>Statistical Predictive Analytics -- www.DMSTAT1.com
>Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 17, 2017, at 10:30 AM, Bert Gunter 
>wrote:
>> 
>> I cannot add to the instructions that you have already been given
>> regarding .Rprofile.
>> 
>> But what code did you use in your .Rprofile to set the prompt? The
>> posting guide explicitly requests that you provide your code,
>although
>> maybe you already did earlier in this extensive thread.
>> 
>> ?options
>> 
>> is how it can be set. Did you do this?
>> 
>> -- Bert
>> 
>> Bert Gunter
>> 
>> "The trouble with having an open mind is that people keep coming
>along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>> 
>> 
>>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD 
>wrote:
>>> David:
>>> When I launch Rstudio the effects of the Rprofile do not show, e.g.,
>I want the prompt to be "R> " instead of the default "> ". The former
>doesn't show.
>>> Bruce
>>> 
>>> __
>>> Bruce Ratner PhD
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analytics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining -- www.GenIQ.net
>>> 
>>> 
>>> 
 On Apr 16, 2017, at 7:34 PM, David Winsemius
> wrote:
 
 
>> 
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread BR_email

Bill:
I did workaround. I created the Rprofile files with file type R, not txt.
Bruce

 


William Dunlap wrote:

I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:

Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 17, 2017, at 10:30 AM, Bert Gunter  wrote:

I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )



On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I want the prompt to be "R> 
" instead of the default "> ". The former doesn't show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net




On Apr 16, 2017, at 7:34 PM, David Winsemius  wrote:



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Henrik Bengtsson
Did you try any of the troubleshooting I suggested? If you do that, I'm
99.99% certain it'll help you to resolve this.

Henrik


On Apr 17, 2017 03:07, "Bruce Ratner PhD"  wrote:

David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I want
the prompt to be "R> " instead of the default "> ". The former doesn't show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 16, 2017, at 7:34 PM, David Winsemius 
wrote:
>
>
>> On Apr 16, 2017, at 3:43 PM, BR_email  wrote:
>>
>> Peter:
>> Thanks for reply and suggestion.
>> Sorry, I am not sure how to assess.
>> The doc is too technical for me to understand.
>> I found multiple instructions online and in R and RStudio books.
>> I'm doing what it says, but no success.
>
> What is "it" and what is "lack of success"?
>
>> The instructions are simple as a-b-c, but some setting within the
Windows system must be the culprit.
>
> Although the RStudio page immediately below was done with a Mac, I
suspect there are similar selection panels and dialogs on the Windows
version of RStudio.
>
> https://support.rstudio.com/hc/en-us/articles/200549016#general
>
> When I look at the Windows installation advice I see near the top: "When
installing on a 64-bit version of Windows the options will include 32- or
64-bit versions of R (and the default is to install both)." So is it
possible that RStudio is looking at a different version of R than you
believe it should be, perhaps at the 32 bit R versus the 64 bit one? The
result at the beginning of this thread makes me think you got the 32-bit
one connected to RStudio.
>
> And I say again: I believe problems in configuring RStudio are off-topic
for Rhelp and you should have been searching or posting question either to
the RStudio support or StackOverflow. Looking at the responses to the
queries above and the ones found below, it appears to me that there are
RStudio-specific issues that go beyond what is in the `help(Startup)` or
equivalent `help(.Rprofile)` page.  I gave an instance of an SO search
upthread and I offer another SO search:
>
> http://stackoverflow.com/search?tab=votes=%5brstudio%
5d%20environment%20variables%20windows
>
> I thought that this one below had potentially useful information, but I
am not a Windows user (and you have not shown an inclination in offering a
complete description of your efforts at following that advice. At any rate
it would have been more appropriate to respond to the SO answers that were
ineffective or to post a question there with full description of your
efforts and content of your .Rprofile file and your current environment
variable settings.)
>
> http://stackoverflow.com/search?tab=votes=%5brstudio%
5d%20rprofile%20windows
>
> --
> David
>
>>
>> Regards,
>> Bruce
>>
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>
>> peter dalgaard wrote:
>>> Um, tried help(.Rprofile) lately?
>>>
>>> -pd
>>>
 On 17 Apr 2017, at 00:08 , Rolf Turner  wrote:


> On 17/04/17 08:46, John C Frain wrote:
>
> Bruce
>
> The official documentation for these startup files can be obtained
with
> the command
>
> Help(Startup)

 Minor point of order, Mr. Chairman.  That should be:

   help(Startup)

 There is (as far as I know) no such function as "Help()".  It is
important to remember that R is case sensitive.

 Another point that is worthy of thought is "How in God's name would
any beginner know or find out about the usage help(Startup)?"  Unless they
were explicitly told about it, in the manner which you just demonstrated.
The usage gets a mention in "An Introduction to R" --- but I had to search
for it.

 To me the word "startup" is not terribly intuitive.  I would tend to
search for "starting" rather than "startup", I think, but I'm not sure what
the average beginner would search for.  A search of "An Introduction to R"
for "starting" gets seven or eight hits, one of which is relevant.  So it
all takes patience and persistence.

 Also note that "An Introduction to R" mostly uses the word "startup"
(lower case "s") and only uses "Startup" twice.  Note also that

   help(startup)

 fails.  You have to get that initial "S" right.

 This isn't a criticism of the documentation.  I'm just pointing out
that there are problems, mostly insoluble.  Until some clever Johnny gets
on with developing that mind_read() function referred to in fortune(182).

 cheers,

 Rolf Turner

 --
 Technical Editor ANZJS
 Department of Statistics
 University of Auckland
 Phone: +64-9-373-7599 ext. 88276

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread William Dunlap via R-help
I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name.  R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Apr 17, 2017 at 7:41 AM, Bruce Ratner PhD  wrote:
> Bert:
> I used note pad under Administrator. The code:
> options(prompt="R> ")
> set.seed(12345)
>
> Bruce
>
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 17, 2017, at 10:30 AM, Bert Gunter  wrote:
>>
>> I cannot add to the instructions that you have already been given
>> regarding .Rprofile.
>>
>> But what code did you use in your .Rprofile to set the prompt? The
>> posting guide explicitly requests that you provide your code, although
>> maybe you already did earlier in this extensive thread.
>>
>> ?options
>>
>> is how it can be set. Did you do this?
>>
>> -- Bert
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
>>> David:
>>> When I launch Rstudio the effects of the Rprofile do not show, e.g., I want 
>>> the prompt to be "R> " instead of the default "> ". The former doesn't show.
>>> Bruce
>>>
>>> __
>>> Bruce Ratner PhD
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analytics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining -- www.GenIQ.net
>>>
>>>
>>>
 On Apr 16, 2017, at 7:34 PM, David Winsemius  
 wrote:


>>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] question about the anova() function for deviance analysis

2017-04-17 Thread Duncan Murdoch

On 16/04/2017 9:46 AM, Sophie Dubois wrote:

Dear Maintener,

I have recently had a bad experience with the anova() function.
Indeed, I wanted to process a deviance analysis between 2 mixed linear
models and I was really surprise to see that depending on the ordre in
which I gave my models, the function did not the same thing: once it
makes the anova of the first model and in the other ordre, it makes a
deviance analysis.
I make lots of formations to researchers who are not always very
comfortable either with R or with some statistical analysis and they
were really very disturbed by that.
Could this be possible to "secure" this anova function in order that
it does the same thing whatever the order in which the models are given?
Hope I was clear enought and many thanks in advance for your regard
about my question.


Could you please post a simple example?  I am guessing that the models 
you are comparing are from different modelling functions, so different 
anova methods were called (it's the first argument that determines what 
is called), but I'm not at all sure without seeing an example.


It doesn't need to be your original data, in fact simpler is better, but 
it should be code that anyone can run.


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Bruce Ratner PhD
Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 17, 2017, at 10:30 AM, Bert Gunter  wrote:
> 
> I cannot add to the instructions that you have already been given
> regarding .Rprofile.
> 
> But what code did you use in your .Rprofile to set the prompt? The
> posting guide explicitly requests that you provide your code, although
> maybe you already did earlier in this extensive thread.
> 
> ?options
> 
> is how it can be set. Did you do this?
> 
> -- Bert
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
>> On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
>> David:
>> When I launch Rstudio the effects of the Rprofile do not show, e.g., I want 
>> the prompt to be "R> " instead of the default "> ". The former doesn't show.
>> Bruce
>> 
>> __
>> Bruce Ratner PhD
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analytics -- www.DMSTAT1.com
>> Machine-Learning Data Mining -- www.GenIQ.net
>> 
>> 
>> 
>>> On Apr 16, 2017, at 7:34 PM, David Winsemius  wrote:
>>> 
>>> 
> 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

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

2017-04-17 Thread Boris Steipe
Ramnik,
a final mail is actually really important: this is to document in the archives, 
for the benefit of those who found the thread at a later time, that the 
responses indeed solved the problem. 

Other than that, the single most important advice is to
- provide a minimal working example of the problem;
- state clearly what you expect;
- state explicitly what happened instead.

Apparently you're doing fine in that regard.


B.


> On Apr 17, 2017, at 10:25 AM, Bert Gunter  wrote:
> 
> (Apparently I hit "send" too early)
> 
> 1. I have cc'ed this to the list, as others may well have some good
> suggestions re: books.
> 
> 2. The posting guide is your best resource as to what is appropriate
> for the list. I defer to others re: conventions, as I have have been
> accused of violating them from time to time.
> 
> 3. R resources abound. RStudio has some recommendations for web
> resource on their site worth checking out:
> 
> https://www.rstudio.com/online-learning/#R
> 
> But there are many others that a search would reveal.
> 
> Hadley Wickham has written a couple of books worth checking. I think
> that the O'Reilly series might have one or more. It is of course
> difficult to judge what "a good book for a newbie" would be in your
> mind, but it is hard for me to believe that there aren't at least
> several out there.
> 
> -- Bert
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Mon, Apr 17, 2017 at 1:06 AM, Ramnik Bansal  
> wrote:
>> Thanks Bert for the reply. It cleared my confusion .
>> 
>> Also am new to the mailing list. Can you please guide me to the mailing list
>> norms. For e.g. when I get a reply to my query which imparts me a better
>> understanding on the topic, is it a norm to thank the individuals who
>> responded, thru a personal mail ? Or it is kind of taken for granted that
>> the question has been replied to and an individual thanks-reply to reply is
>> not even expected as it will increase the number of mails.
>> 
>> Also what seems to be missing is a good book on R which talks about all
>> these nuances even for a newbie who wants to master R. Or maybe am unaware
>> of one such book.
>> 
>> -Best
>> Ramnik
>> 
>> 
>> On Mon, Apr 17, 2017 at 10:20 AM, Bert Gunter 
>> wrote:
>>> 
>>> David et. al.:
>>> 
>>> "this levels is the level where you realize that the `for` function is
>>> different from most other R functions.  It is really a
>>> side-effect-fucntion. "
>>> 
>>> for(), while(), if(), next, etc. are *not* functions.
>>> 
>>> ?for says: "These are the basic control-flow constructs of the R
>>> language."
>>> 
>>> They do not "return" values. They control program flow, whence what
>>> you call "side effects" are actually expressions that are parsed and
>>> evaluated
>>> 
>>> viz.
>>> 
 if(TRUE)10
>>> [1] 10
>>> 
>>> ## but
>>> 
 if(FALSE) 5
>>> ## nothing 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,
>>> Bert
>>> 
>>> 
>>> 
>>> 
>>> Bert Gunter
>>> 
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> 
>>> 
>>> On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius 
>>> wrote:
 
> On Apr 16, 2017, at 7:26 PM, Ramnik Bansal 
> wrote:
> 
> 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) }*
> 
> Then
> *n<-3;ff(n)->op;rm(n);print(op)*
> gives 4 as output.
> 
> My question is *Which *is considered as the last line in a functoin for
> the
> purpsoe of default return ? And under what conditions ?
 
 It's probably a good thing that you are confused. It suggests that you
 are actually "getting" the R-paradigm. Unfortunately for the new user of R,
 there are several levels of understanding to pass through. First, you
 realize that function-results need to be assigned to names in order to
 persist. Then there is the next level where you discover that there are
 exceptions to that rule: this levels is the level where you realize that 
 the
 `for` function is different from most other R functions.  It is really a
 side-effect-fucntion. The assignments made within its body actually persist
 in the global environment. AND it returns NULL. 

Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Bert Gunter
I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 3:06 AM, Bruce Ratner PhD  wrote:
> David:
> When I launch Rstudio the effects of the Rprofile do not show, e.g., I want 
> the prompt to be "R> " instead of the default "> ". The former doesn't show.
> Bruce
>
> __
> Bruce Ratner PhD
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analytics -- www.DMSTAT1.com
> Machine-Learning Data Mining -- www.GenIQ.net
>
>
>
>> On Apr 16, 2017, at 7:34 PM, David Winsemius  wrote:
>>
>>
>>> On Apr 16, 2017, at 3:43 PM, BR_email  wrote:
>>>
>>> Peter:
>>> Thanks for reply and suggestion.
>>> Sorry, I am not sure how to assess.
>>> The doc is too technical for me to understand.
>>> I found multiple instructions online and in R and RStudio books.
>>> I'm doing what it says, but no success.
>>
>> What is "it" and what is "lack of success"?
>>
>>> The instructions are simple as a-b-c, but some setting within the Windows 
>>> system must be the culprit.
>>
>> Although the RStudio page immediately below was done with a Mac, I suspect 
>> there are similar selection panels and dialogs on the Windows version of 
>> RStudio.
>>
>> https://support.rstudio.com/hc/en-us/articles/200549016#general
>>
>> When I look at the Windows installation advice I see near the top: "When 
>> installing on a 64-bit version of Windows the options will include 32- or 
>> 64-bit versions of R (and the default is to install both)." So is it 
>> possible that RStudio is looking at a different version of R than you 
>> believe it should be, perhaps at the 32 bit R versus the 64 bit one? The 
>> result at the beginning of this thread makes me think you got the 32-bit one 
>> connected to RStudio.
>>
>> And I say again: I believe problems in configuring RStudio are off-topic for 
>> Rhelp and you should have been searching or posting question either to the 
>> RStudio support or StackOverflow. Looking at the responses to the queries 
>> above and the ones found below, it appears to me that there are 
>> RStudio-specific issues that go beyond what is in the `help(Startup)` or 
>> equivalent `help(.Rprofile)` page.  I gave an instance of an SO search 
>> upthread and I offer another SO search:
>>
>> http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20environment%20variables%20windows
>>
>> I thought that this one below had potentially useful information, but I am 
>> not a Windows user (and you have not shown an inclination in offering a 
>> complete description of your efforts at following that advice. At any rate 
>> it would have been more appropriate to respond to the SO answers that were 
>> ineffective or to post a question there with full description of your 
>> efforts and content of your .Rprofile file and your current environment 
>> variable settings.)
>>
>> http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20rprofile%20windows
>>
>> --
>> David
>>
>>>
>>> Regards,
>>> Bruce
>>>
>>> Bruce Ratner, Ph.D.
>>> The Significant Statistician™
>>> (516) 791-3544
>>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>>
>>> peter dalgaard wrote:
 Um, tried help(.Rprofile) lately?

 -pd

> On 17 Apr 2017, at 00:08 , Rolf Turner  wrote:
>
>
>> On 17/04/17 08:46, John C Frain wrote:
>>
>> Bruce
>>
>> The official documentation for these startup files can be obtained with
>> the command
>>
>> Help(Startup)
>
> Minor point of order, Mr. Chairman.  That should be:
>
>   help(Startup)
>
> There is (as far as I know) no such function as "Help()".  It is 
> important to remember that R is case sensitive.
>
> Another point that is worthy of thought is "How in God's name would any 
> beginner know or find out about the usage help(Startup)?"  Unless they 
> were explicitly told about it, in the manner which you just demonstrated. 
>  The usage gets a mention in "An Introduction to R" --- but I had to 
> search for it.
>
> To me the word "startup" is not terribly intuitive.  I would tend to 
> search for "starting" rather than "startup", I think, but I'm not sure 
> what the average beginner would search for.  A search of "An Introduction 
> to R" for "starting" gets seven or eight hits, one of which is relevant.  
> So it all takes patience and 

[R-es] Error en sql UpDate

2017-04-17 Thread Andres Hirigoyen
Buenos días,  al querer actualizar los datos de una tabla en SQL SERVER
sale el siguiente error:

Error in sqlUpdate(canal_conexion, Datos, tablename =
"Tabla_SQL_SERVER_Actualizar",  :
  [RODBC] Failed exec in Update22018 0 [Microsoft][ODBC SQL Server
Driver]Invalid character value for cast specification

Gracias desde ya por la ayuda.

--

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


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

2017-04-17 Thread Bert Gunter
(Apparently I hit "send" too early)

1. I have cc'ed this to the list, as others may well have some good
suggestions re: books.

2. The posting guide is your best resource as to what is appropriate
for the list. I defer to others re: conventions, as I have have been
accused of violating them from time to time.

3. R resources abound. RStudio has some recommendations for web
resource on their site worth checking out:

https://www.rstudio.com/online-learning/#R

But there are many others that a search would reveal.

Hadley Wickham has written a couple of books worth checking. I think
that the O'Reilly series might have one or more. It is of course
difficult to judge what "a good book for a newbie" would be in your
mind, but it is hard for me to believe that there aren't at least
several out there.

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Apr 17, 2017 at 1:06 AM, Ramnik Bansal  wrote:
> Thanks Bert for the reply. It cleared my confusion .
>
> Also am new to the mailing list. Can you please guide me to the mailing list
> norms. For e.g. when I get a reply to my query which imparts me a better
> understanding on the topic, is it a norm to thank the individuals who
> responded, thru a personal mail ? Or it is kind of taken for granted that
> the question has been replied to and an individual thanks-reply to reply is
> not even expected as it will increase the number of mails.
>
> Also what seems to be missing is a good book on R which talks about all
> these nuances even for a newbie who wants to master R. Or maybe am unaware
> of one such book.
>
> -Best
> Ramnik
>
>
> On Mon, Apr 17, 2017 at 10:20 AM, Bert Gunter 
> wrote:
>>
>> David et. al.:
>>
>> "this levels is the level where you realize that the `for` function is
>> different from most other R functions.  It is really a
>> side-effect-fucntion. "
>>
>> for(), while(), if(), next, etc. are *not* functions.
>>
>> ?for says: "These are the basic control-flow constructs of the R
>> language."
>>
>> They do not "return" values. They control program flow, whence what
>> you call "side effects" are actually expressions that are parsed and
>> evaluated
>>
>> viz.
>>
>> > if(TRUE)10
>> [1] 10
>>
>> ## but
>>
>> >if(FALSE) 5
>> ## nothing 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,
>> Bert
>>
>>
>>
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius 
>> wrote:
>> >
>> >> On Apr 16, 2017, at 7:26 PM, Ramnik Bansal 
>> >> wrote:
>> >>
>> >> 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) }*
>> >>
>> >> Then
>> >> *n<-3;ff(n)->op;rm(n);print(op)*
>> >> gives 4 as output.
>> >>
>> >> My question is *Which *is considered as the last line in a functoin for
>> >> the
>> >> purpsoe of default return ? And under what conditions ?
>> >
>> > It's probably a good thing that you are confused. It suggests that you
>> > are actually "getting" the R-paradigm. Unfortunately for the new user of R,
>> > there are several levels of understanding to pass through. First, you
>> > realize that function-results need to be assigned to names in order to
>> > persist. Then there is the next level where you discover that there are
>> > exceptions to that rule: this levels is the level where you realize that 
>> > the
>> > `for` function is different from most other R functions.  It is really a
>> > side-effect-fucntion. The assignments made within its body actually persist
>> > in the global environment. AND it returns NULL. It shares this anomalous
>> > behavior with `while` and `repeat`.n Almost all functions are invoked with 
>> > a
>> > possibly empty argument list.  The next and break functions have implicit
>> > paired (empty) parentheses.
>> >
>> > (My personal opinion is that this is not adequately advertised. Perhaps
>> > it is an attempt to get people to migrate away from "Fortran-coding"
>> > behavior?)
>> >
>> > --
>> > David.
>> >
>> >
>> >>
>> >> -Thanks,
>> >> Ramnik
>> >>
>> >>   [[alternative HTML version deleted]]
>> >>
>> >> __
>> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> >> 

Re: [R] qqplot for binomial distribution

2017-04-17 Thread Boris Steipe
That's not how qqline() works. The line is drawn with respect to a 
_reference_distribution_ which is the normal distribution by default. For the 
binomial distribution, you need to specify the distribution argument. There is 
an example in the help page that shows you how this is done for qchisq(). for 
qbinom() it is:


set.seed(123)
qqplot(rbinom(n=100, size=100, p=0.05), 
   rbinom(n=100, size=100, p=0.05) )
 
qqline(rbinom(n=100,size=100,p=.05),
   distribution = function(probs) { qbinom(probs, size=100, prob=0.05) },
   col = "red",
   lwd = 0.5)




B.


> On Apr 17, 2017, at 9:15 AM, Ashim Kapoor  wrote:
> 
> Dear Spencer,
> 
> Okay. Many thanks. My next query is how do I use qqline?
> 
> When I try
> 
>> qqline(rbinom(n=100,size=100,p=.05))
> 
> I don't get the line in the right place.
> 
> Best Regards,
> Ashim
> 
> On Mon, Apr 17, 2017 at 6:31 PM, Spencer Graves <
> spencer.gra...@effectivedefense.org> wrote:
> 
>> 
>> 
>> On 2017-04-17 7:58 AM, Ashim Kapoor wrote:
>> 
>>> Dear All,
>>> 
>>> set.seed(123)
>>> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )
>>> 
>>> I expect to see 1 clear line,but I don't. What am I misunderstanding?
>>> 
>> 
>> 
>>  The distribution is discrete, and points are superimposed. Try the
>> following:
>> 
>> 
>> set.seed(123)
>> qqplot(jitter(rbinom(n=100,size=100,p=.05)),
>>   jitter(rbinom(n=100,size=100,p=.05) ))
>> 
>> 
>>  Spencer Graves
>> 
>>> 
>>> Best Regards,
>>> Ashim
>>> 
>>>[[alternative HTML version deleted]]
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posti
>>> ng-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>> 
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posti
>> ng-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


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

2017-04-17 Thread Bert Gunter
OK. I stand corrected. Thanks.

-- Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Apr 16, 2017 at 11:36 PM, David Winsemius
 wrote:
> Both 'for' and 'next' return TRUE from is.function
>
> is.function('for')
> is.function('next')
>
> Not at an R console at the moment but I did check this earlier today. 
> Thinking of it as different is definitely the way to think about it. (ISTR 
> Bert and I have had this exchange in the past.)
>
> --
> Best
> David
>
> Sent from my iPhone
>
>> On Apr 16, 2017, at 9:50 PM, Bert Gunter  wrote:
>>
>> David et. al.:
>>
>> "this levels is the level where you realize that the `for` function is
>> different from most other R functions.  It is really a
>> side-effect-fucntion. "
>>
>> for(), while(), if(), next, etc. are *not* functions.
>>
>> ?for says: "These are the basic control-flow constructs of the R language."
>>
>> They do not "return" values. They control program flow, whence what
>> you call "side effects" are actually expressions that are parsed and
>> evaluated
>>
>> viz.
>>
>>> if(TRUE)10
>> [1] 10
>>
>> ## but
>>
>>> if(FALSE) 5
>> ## nothing 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,
>> Bert
>>
>>
>>
>>
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>>> On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius  
>>> wrote:
>>>
 On Apr 16, 2017, at 7:26 PM, Ramnik Bansal  wrote:

 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) }*

 Then
 *n<-3;ff(n)->op;rm(n);print(op)*
 gives 4 as output.

 My question is *Which *is considered as the last line in a functoin for the
 purpsoe of default return ? And under what conditions ?
>>>
>>> It's probably a good thing that you are confused. It suggests that you are 
>>> actually "getting" the R-paradigm. Unfortunately for the new user of R, 
>>> there are several levels of understanding to pass through. First, you 
>>> realize that function-results need to be assigned to names in order to 
>>> persist. Then there is the next level where you discover that there are 
>>> exceptions to that rule: this levels is the level where you realize that 
>>> the `for` function is different from most other R functions.  It is really 
>>> a side-effect-fucntion. The assignments made within its body actually 
>>> persist in the global environment. AND it returns NULL. It shares this 
>>> anomalous behavior with `while` and `repeat`.n Almost all functions are 
>>> invoked with a possibly empty argument list.  The next and break functions 
>>> have implicit paired (empty) parentheses.
>>>
>>> (My personal opinion is that this is not adequately advertised. Perhaps it 
>>> is an attempt to get people to migrate away from "Fortran-coding" behavior?)
>>>
>>> --
>>> David.
>>>
>>>

 -Thanks,
 Ramnik

  [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.
>>>
>>> David Winsemius
>>> Alameda, CA, USA
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


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

2017-04-17 Thread peter dalgaard

> On 17 Apr 2017, at 10:04 , Ramnik Bansal  wrote:
> 
> This is my output for is.function
> 
>> is.function("for")
> [1] FALSE
>> is.function(for)
> Error: unexpected ')' in "is.function(for)"
>> is.function("next")
> [1] FALSE
>> is.function(next)
> Error: no loop for break/next, jumping to top level
> 
> *I did not get the TRUE value. R version 3.3.3 on Mac. What am I doing
> different ?*

You need backticks:

> is.function(`for`)
[1] TRUE
> is.function(`next`)
[1] TRUE
> `for`
.Primitive("for")
> `next`
.Primitive("next")

David either should have typed backticks, or he did type them, only to have a 
friendly e-mail client autocorrect them into quotes...

-pd

> 
> Packages detail
>> search()
> [1] ".GlobalEnv""package:pryr"
> [3] "tools:RGUI""package:stats"
> [5] "package:graphics"  "package:grDevices"
> [7] "package:utils" "package:datasets"
> [9] "package:methods"   "Autoloads"
> [11] "package:base"
> 
> thanks
> Ramnik
> 
> On Mon, Apr 17, 2017 at 12:06 PM, David Winsemius 
> wrote:
> 
>> Both 'for' and 'next' return TRUE from is.function
>> 
>> is.function('for')
>> is.function('next')
>> 
>> Not at an R console at the moment but I did check this earlier today.
>> Thinking of it as different is definitely the way to think about it. (ISTR
>> Bert and I have had this exchange in the past.)
>> 
>> --
>> Best
>> David
>> 
>> Sent from my iPhone
>> 
>>> On Apr 16, 2017, at 9:50 PM, Bert Gunter  wrote:
>>> 
>>> David et. al.:
>>> 
>>> "this levels is the level where you realize that the `for` function is
>>> different from most other R functions.  It is really a
>>> side-effect-fucntion. "
>>> 
>>> for(), while(), if(), next, etc. are *not* functions.
>>> 
>>> ?for says: "These are the basic control-flow constructs of the R
>> language."
>>> 
>>> They do not "return" values. They control program flow, whence what
>>> you call "side effects" are actually expressions that are parsed and
>>> evaluated
>>> 
>>> viz.
>>> 
 if(TRUE)10
>>> [1] 10
>>> 
>>> ## but
>>> 
 if(FALSE) 5
>>> ## nothing 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,
>>> Bert
>>> 
>>> 
>>> 
>>> 
>>> Bert Gunter
>>> 
>>> "The trouble with having an open mind is that people keep coming along
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> 
>>> 
 On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius <
>> dwinsem...@comcast.net> wrote:
 
> On Apr 16, 2017, at 7:26 PM, Ramnik Bansal 
>> wrote:
> 
> 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) }*
> 
> Then
> *n<-3;ff(n)->op;rm(n);print(op)*
> gives 4 as output.
> 
> My question is *Which *is considered as the last line in a functoin
>> for the
> purpsoe of default return ? And under what conditions ?
 
 It's probably a good thing that you are confused. It suggests that you
>> are actually "getting" the R-paradigm. Unfortunately for the new user of R,
>> there are several levels of understanding to pass through. First, you
>> realize that function-results need to be assigned to names in order to
>> persist. Then there is the next level where you discover that there are
>> exceptions to that rule: this levels is the level where you realize that
>> the `for` function is different from most other R functions.  It is really
>> a side-effect-fucntion. The assignments made within its body actually
>> persist in the global environment. AND it returns NULL. It shares this
>> anomalous behavior with `while` and `repeat`.n Almost all functions are
>> invoked with a possibly empty argument list.  The next and break functions
>> have implicit paired (empty) parentheses.
 
 (My personal opinion is that this is not adequately advertised. Perhaps
>> it is an attempt to get people to migrate away from "Fortran-coding"
>> behavior?)
 
 --
 David.
 
 
> 
> -Thanks,
> Ramnik
> 
> [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
 
 David Winsemius
 Alameda, CA, USA
 
 __
 

Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
Dear Boris,

Okay and Thanks.

Best,
Ashim

On Mon, Apr 17, 2017 at 6:45 PM, Boris Steipe 
wrote:

> Moreover, setting the seed once, then evaluating two functions means you
> are sampling from the same distributions, but you do in fact have different
> values. Outliers in the rarefied tails of the distribution may lie quite
> considerably off the expected diagonal. Try
>
> set.seed(123)
> qqplot(rbinom(n=1000, size=1000, p=0.05),
>rbinom(n=1000, size=1000, p=0.05))
>
> and you will find that you approximate the "1 clear line" quite well - for
> most of the values.
>
>
> B.
>
>
>
>
> > On Apr 17, 2017, at 9:01 AM, Spencer Graves  effectivedefense.org> wrote:
> >
> >
> >
> > On 2017-04-17 7:58 AM, Ashim Kapoor wrote:
> >> Dear All,
> >>
> >> set.seed(123)
> >> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )
> >>
> >> I expect to see 1 clear line,but I don't. What am I misunderstanding?
> >
> >
> >  The distribution is discrete, and points are superimposed. Try the
> following:
> >
> >
> > set.seed(123)
> > qqplot(jitter(rbinom(n=100,size=100,p=.05)),
> >   jitter(rbinom(n=100,size=100,p=.05) ))
> >
> >
> >  Spencer Graves
> >>
> >> Best Regards,
> >> Ashim
> >>
> >>  [[alternative HTML version deleted]]
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> 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.
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] qqplot for binomial distribution

2017-04-17 Thread Boris Steipe
Moreover, setting the seed once, then evaluating two functions means you are 
sampling from the same distributions, but you do in fact have different values. 
Outliers in the rarefied tails of the distribution may lie quite considerably 
off the expected diagonal. Try

set.seed(123)
qqplot(rbinom(n=1000, size=1000, p=0.05),
   rbinom(n=1000, size=1000, p=0.05))

and you will find that you approximate the "1 clear line" quite well - for most 
of the values.


B.




> On Apr 17, 2017, at 9:01 AM, Spencer Graves 
>  wrote:
> 
> 
> 
> On 2017-04-17 7:58 AM, Ashim Kapoor wrote:
>> Dear All,
>> 
>> set.seed(123)
>> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )
>> 
>> I expect to see 1 clear line,but I don't. What am I misunderstanding?
> 
> 
>  The distribution is discrete, and points are superimposed. Try the 
> following:
> 
> 
> set.seed(123)
> qqplot(jitter(rbinom(n=100,size=100,p=.05)),
>   jitter(rbinom(n=100,size=100,p=.05) ))
> 
> 
>  Spencer Graves
>> 
>> Best Regards,
>> Ashim
>> 
>>  [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
Dear Spencer,

Okay. Many thanks. My next query is how do I use qqline?

When I try

> qqline(rbinom(n=100,size=100,p=.05))

I don't get the line in the right place.

Best Regards,
Ashim

On Mon, Apr 17, 2017 at 6:31 PM, Spencer Graves <
spencer.gra...@effectivedefense.org> wrote:

>
>
> On 2017-04-17 7:58 AM, Ashim Kapoor wrote:
>
>> Dear All,
>>
>> set.seed(123)
>> qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )
>>
>> I expect to see 1 clear line,but I don't. What am I misunderstanding?
>>
>
>
>   The distribution is discrete, and points are superimposed. Try the
> following:
>
>
> set.seed(123)
> qqplot(jitter(rbinom(n=100,size=100,p=.05)),
>jitter(rbinom(n=100,size=100,p=.05) ))
>
>
>   Spencer Graves
>
>>
>> Best Regards,
>> Ashim
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posti
>> ng-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] qqplot for binomial distribution

2017-04-17 Thread Spencer Graves



On 2017-04-17 7:58 AM, Ashim Kapoor wrote:

Dear All,

set.seed(123)
qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )

I expect to see 1 clear line,but I don't. What am I misunderstanding?



  The distribution is discrete, and points are superimposed. Try 
the following:



set.seed(123)
qqplot(jitter(rbinom(n=100,size=100,p=.05)),
   jitter(rbinom(n=100,size=100,p=.05) ))


  Spencer Graves


Best Regards,
Ashim

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] qqplot for binomial distribution

2017-04-17 Thread Ashim Kapoor
Dear All,

set.seed(123)
qqplot(rbinom(n=100,size=100,p=.05), rbinom(n=100,size=100,p=.05) )

I expect to see 1 clear line,but I don't. What am I misunderstanding?

Best Regards,
Ashim

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] help on readBin in R

2017-04-17 Thread Barry Rowlingson
There's very little justification for attaching binary files to a
mailing list these days - share it on Dropbox, or Box, or Hubic, or
whatever MS or Google's cloud storage is, or simply tell us where it
was obtained from originally.

And to the original poster - some more context is very useful - where
did you get it from, what area is it supposed to cover, etc etc.

I hope you don't want to do any serious science with a data file that
you have no provenance for.



On Mon, Apr 17, 2017 at 4:13 AM, Jeff Newmiller
 wrote:
> That may or may not work, since text file newlines get altered in them. May 
> have more luck with a "png" extension?
> --
> Sent from my phone. Please excuse my brevity.
>
> On April 16, 2017 7:33:06 PM PDT, jim holtman  wrote:
>>If the file is not too large, just change the extension to '.txt' and
>>attach it.  Also include the code that you are using to read it in and
>>a definition of the what the data is; e.g., first two byte are
>>temperature, next four bytes are a station ID, 
>>
>>Here is an example of reading in a binary file and I know that the
>>'raw' output matches the bytes that are in the file:
>>
>>> infile <- file("test.txt", 'rb')
>>>
>>> input <- readBin(infile, raw(), 100)
>>>
>>> input
>>  [1] 50 4b 03 04 14 00 04 00 08 00 47 95 90 4a 9f 00 7a a0 99 01 00
>>00 7a 08 00 00 13 00 75 00 5b 43 6f
>> [34] 6e 74 65 6e 74 5f 54 79 70 65 73 5d 2e 78 6d 6c 53 44 60 00 a4
>>00 00 00 00 08 00 32 fa a9 3f 63 64
>> [67] 60 69 11 61 60 60 30 00 62 10 f0 01 62 46 56 30 93 55 14 48 55
>>e8 cd 15 fe e5 cf a3 df 6c ab ed 66
>>[100] b1
>>>
>>
>>here is the dump:
>>
>>$ od -a -t x --endian=big test.txt
>>000   P   K etx eot dc4 nul eot nul  bs nul   G nak dle   J  us nul
>>   504b03041400040008004795904a9f00
>>020   z  sp  em soh nul nul   z  bs nul nul dc3 nul   u nul   [   C
>>   7aa099017a08130075005b43
>>040   o   n   t   e   n   t   _   T   y   p   e   s   ]   .   x   m
>>   6f6e74656e745f54797065735d2e786d
>>
>>Jim Holtman
>>Data Munger Guru
>>
>>What is the problem that you are trying to solve?
>>Tell me what you want to do, not how you want to do it.
>>
>>
>>On Sun, Apr 16, 2017 at 9:21 PM, Jeff Newmiller
>> wrote:
>>> The mailing list has tight restrictions on attachments, so your
>>attachment was not let through. Read the Posting Guide, and note that
>>sometimes success requires some extended understanding of how your mail
>>software works, and we probably don't know the details either. You
>>might have success changing the file extension or sending a link to the
>>file on a file storage website like Google Drive or Dropbox.
>>> --
>>> Sent from my phone. Please excuse my brevity.
>>>
>>> On April 16, 2017 3:49:07 PM PDT, "M.M saifuddin"
>> wrote:
I need to view the attached  binary file. but can not read it,
>>instead
am
getting very weird( i think garbage) numbers.

The values are Temperature data so it should be somewhat in between
>>250
to
500.

Can any altruist view it and give me the R code to view it.

I am attaching the file. Please help me if you can.

TIA
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Setting .Rprofile for RStudio on a Windows 7 x64bit

2017-04-17 Thread Bruce Ratner PhD
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I want the 
prompt to be "R> " instead of the default "> ". The former doesn't show.
Bruce

__
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net



> On Apr 16, 2017, at 7:34 PM, David Winsemius  wrote:
> 
> 
>> On Apr 16, 2017, at 3:43 PM, BR_email  wrote:
>> 
>> Peter:
>> Thanks for reply and suggestion.
>> Sorry, I am not sure how to assess.
>> The doc is too technical for me to understand.
>> I found multiple instructions online and in R and RStudio books.
>> I'm doing what it says, but no success.
> 
> What is "it" and what is "lack of success"?
> 
>> The instructions are simple as a-b-c, but some setting within the Windows 
>> system must be the culprit.
> 
> Although the RStudio page immediately below was done with a Mac, I suspect 
> there are similar selection panels and dialogs on the Windows version of 
> RStudio.
> 
> https://support.rstudio.com/hc/en-us/articles/200549016#general
> 
> When I look at the Windows installation advice I see near the top: "When 
> installing on a 64-bit version of Windows the options will include 32- or 
> 64-bit versions of R (and the default is to install both)." So is it possible 
> that RStudio is looking at a different version of R than you believe it 
> should be, perhaps at the 32 bit R versus the 64 bit one? The result at the 
> beginning of this thread makes me think you got the 32-bit one connected to 
> RStudio.
> 
> And I say again: I believe problems in configuring RStudio are off-topic for 
> Rhelp and you should have been searching or posting question either to the 
> RStudio support or StackOverflow. Looking at the responses to the queries 
> above and the ones found below, it appears to me that there are 
> RStudio-specific issues that go beyond what is in the `help(Startup)` or 
> equivalent `help(.Rprofile)` page.  I gave an instance of an SO search 
> upthread and I offer another SO search:
> 
> http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20environment%20variables%20windows
> 
> I thought that this one below had potentially useful information, but I am 
> not a Windows user (and you have not shown an inclination in offering a 
> complete description of your efforts at following that advice. At any rate it 
> would have been more appropriate to respond to the SO answers that were 
> ineffective or to post a question there with full description of your efforts 
> and content of your .Rprofile file and your current environment variable 
> settings.)
> 
> http://stackoverflow.com/search?tab=votes=%5brstudio%5d%20rprofile%20windows
> 
> -- 
> David
> 
>> 
>> Regards,
>> Bruce
>> 
>> Bruce Ratner, Ph.D.
>> The Significant Statistician™
>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>> 
>> peter dalgaard wrote:
>>> Um, tried help(.Rprofile) lately?
>>> 
>>> -pd
>>> 
 On 17 Apr 2017, at 00:08 , Rolf Turner  wrote:
 
 
> On 17/04/17 08:46, John C Frain wrote:
> 
> Bruce
> 
> The official documentation for these startup files can be obtained with
> the command
> 
> Help(Startup)
 
 Minor point of order, Mr. Chairman.  That should be:
 
   help(Startup)
 
 There is (as far as I know) no such function as "Help()".  It is important 
 to remember that R is case sensitive.
 
 Another point that is worthy of thought is "How in God's name would any 
 beginner know or find out about the usage help(Startup)?"  Unless they 
 were explicitly told about it, in the manner which you just demonstrated.  
 The usage gets a mention in "An Introduction to R" --- but I had to search 
 for it.
 
 To me the word "startup" is not terribly intuitive.  I would tend to 
 search for "starting" rather than "startup", I think, but I'm not sure 
 what the average beginner would search for.  A search of "An Introduction 
 to R" for "starting" gets seven or eight hits, one of which is relevant.  
 So it all takes patience and persistence.
 
 Also note that "An Introduction to R" mostly uses the word "startup" 
 (lower case "s") and only uses "Startup" twice.  Note also that
 
   help(startup)
 
 fails.  You have to get that initial "S" right.
 
 This isn't a criticism of the documentation.  I'm just pointing out that 
 there are problems, mostly insoluble.  Until some clever Johnny gets on 
 with developing that mind_read() function referred to in fortune(182).
 
 cheers,
 
 Rolf Turner
 
 -- 
 Technical Editor ANZJS
 Department of Statistics
 University of Auckland
 Phone: +64-9-373-7599 ext. 88276
 
 

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

2017-04-17 Thread Ramnik Bansal
This is my output for is.function

> is.function("for")
[1] FALSE
> is.function(for)
Error: unexpected ')' in "is.function(for)"
> is.function("next")
[1] FALSE
> is.function(next)
Error: no loop for break/next, jumping to top level

*I did not get the TRUE value. R version 3.3.3 on Mac. What am I doing
different ?*

Packages detail
> search()
 [1] ".GlobalEnv""package:pryr"
 [3] "tools:RGUI""package:stats"
 [5] "package:graphics"  "package:grDevices"
 [7] "package:utils" "package:datasets"
 [9] "package:methods"   "Autoloads"
[11] "package:base"

thanks
Ramnik

On Mon, Apr 17, 2017 at 12:06 PM, David Winsemius 
wrote:

> Both 'for' and 'next' return TRUE from is.function
>
> is.function('for')
> is.function('next')
>
> Not at an R console at the moment but I did check this earlier today.
> Thinking of it as different is definitely the way to think about it. (ISTR
> Bert and I have had this exchange in the past.)
>
> --
> Best
> David
>
> Sent from my iPhone
>
> > On Apr 16, 2017, at 9:50 PM, Bert Gunter  wrote:
> >
> > David et. al.:
> >
> > "this levels is the level where you realize that the `for` function is
> > different from most other R functions.  It is really a
> > side-effect-fucntion. "
> >
> > for(), while(), if(), next, etc. are *not* functions.
> >
> > ?for says: "These are the basic control-flow constructs of the R
> language."
> >
> > They do not "return" values. They control program flow, whence what
> > you call "side effects" are actually expressions that are parsed and
> > evaluated
> >
> > viz.
> >
> >> if(TRUE)10
> > [1] 10
> >
> > ## but
> >
> >> if(FALSE) 5
> > ## nothing 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,
> > Bert
> >
> >
> >
> >
> > Bert Gunter
> >
> > "The trouble with having an open mind is that people keep coming along
> > and sticking things into it."
> > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> >
> >
> >> On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius <
> dwinsem...@comcast.net> wrote:
> >>
> >>> On Apr 16, 2017, at 7:26 PM, Ramnik Bansal 
> wrote:
> >>>
> >>> 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) }*
> >>>
> >>> Then
> >>> *n<-3;ff(n)->op;rm(n);print(op)*
> >>> gives 4 as output.
> >>>
> >>> My question is *Which *is considered as the last line in a functoin
> for the
> >>> purpsoe of default return ? And under what conditions ?
> >>
> >> It's probably a good thing that you are confused. It suggests that you
> are actually "getting" the R-paradigm. Unfortunately for the new user of R,
> there are several levels of understanding to pass through. First, you
> realize that function-results need to be assigned to names in order to
> persist. Then there is the next level where you discover that there are
> exceptions to that rule: this levels is the level where you realize that
> the `for` function is different from most other R functions.  It is really
> a side-effect-fucntion. The assignments made within its body actually
> persist in the global environment. AND it returns NULL. It shares this
> anomalous behavior with `while` and `repeat`.n Almost all functions are
> invoked with a possibly empty argument list.  The next and break functions
> have implicit paired (empty) parentheses.
> >>
> >> (My personal opinion is that this is not adequately advertised. Perhaps
> it is an attempt to get people to migrate away from "Fortran-coding"
> behavior?)
> >>
> >> --
> >> David.
> >>
> >>
> >>>
> >>> -Thanks,
> >>> Ramnik
> >>>
> >>>  [[alternative HTML version deleted]]
> >>>
> >>> __
> >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >>> 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.
> >>
> >> David Winsemius
> >> Alameda, CA, USA
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> 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.
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do 

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

2017-04-17 Thread David Winsemius
Both 'for' and 'next' return TRUE from is.function 

is.function('for')
is.function('next')

Not at an R console at the moment but I did check this earlier today. Thinking 
of it as different is definitely the way to think about it. (ISTR Bert and I 
have had this exchange in the past.)

-- 
Best
David

Sent from my iPhone

> On Apr 16, 2017, at 9:50 PM, Bert Gunter  wrote:
> 
> David et. al.:
> 
> "this levels is the level where you realize that the `for` function is
> different from most other R functions.  It is really a
> side-effect-fucntion. "
> 
> for(), while(), if(), next, etc. are *not* functions.
> 
> ?for says: "These are the basic control-flow constructs of the R language."
> 
> They do not "return" values. They control program flow, whence what
> you call "side effects" are actually expressions that are parsed and
> evaluated
> 
> viz.
> 
>> if(TRUE)10
> [1] 10
> 
> ## but
> 
>> if(FALSE) 5
> ## nothing 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,
> Bert
> 
> 
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
>> On Sun, Apr 16, 2017 at 8:12 PM, David Winsemius  
>> wrote:
>> 
>>> On Apr 16, 2017, at 7:26 PM, Ramnik Bansal  wrote:
>>> 
>>> 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) }*
>>> 
>>> Then
>>> *n<-3;ff(n)->op;rm(n);print(op)*
>>> gives 4 as output.
>>> 
>>> My question is *Which *is considered as the last line in a functoin for the
>>> purpsoe of default return ? And under what conditions ?
>> 
>> It's probably a good thing that you are confused. It suggests that you are 
>> actually "getting" the R-paradigm. Unfortunately for the new user of R, 
>> there are several levels of understanding to pass through. First, you 
>> realize that function-results need to be assigned to names in order to 
>> persist. Then there is the next level where you discover that there are 
>> exceptions to that rule: this levels is the level where you realize that the 
>> `for` function is different from most other R functions.  It is really a 
>> side-effect-fucntion. The assignments made within its body actually persist 
>> in the global environment. AND it returns NULL. It shares this anomalous 
>> behavior with `while` and `repeat`.n Almost all functions are invoked with a 
>> possibly empty argument list.  The next and break functions have implicit 
>> paired (empty) parentheses.
>> 
>> (My personal opinion is that this is not adequately advertised. Perhaps it 
>> is an attempt to get people to migrate away from "Fortran-coding" behavior?)
>> 
>> --
>> David.
>> 
>> 
>>> 
>>> -Thanks,
>>> Ramnik
>>> 
>>>  [[alternative HTML version deleted]]
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> 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.
>> 
>> David Winsemius
>> Alameda, CA, USA
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.