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

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,

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,

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

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

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,

[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

[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,

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

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,

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

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)

[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

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,

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

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

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

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

[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

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

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

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

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

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

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

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

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

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

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

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 --

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

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

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

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

[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

[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

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

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

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

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"

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

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,

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

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

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

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

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

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

[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

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

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

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

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

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

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)

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

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:

[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]] __

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 -

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

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

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