Re: [R] Creatng new variable based upon conditions

2018-07-26 Thread Bert Gunter
Inline. > > > On 07/26/2018 08:58 PM, JEFFERY REICHMAN wrote: > >> Given something like ... >> >> x <- c(3,2,4,3,5,4,3,2,4,5) >> y <- c("A","B","B","A","A","A","A","B","A","B") >> xy <- data.frame(x,y) >> xy$w <- ifelse(xy$y=="A",xy$w[,x]*10,xy$w[,x]*15 ) >> > > You should learn the basics about

Re: [R] Creatng new variable based upon conditions

2018-07-26 Thread Dénes Tóth
On 07/26/2018 08:58 PM, JEFFERY REICHMAN wrote: Given something like ... x <- c(3,2,4,3,5,4,3,2,4,5) y <- c("A","B","B","A","A","A","A","B","A","B") xy <- data.frame(x,y) xy$w <- ifelse(xy$y=="A",xy$w[,x]*10,xy$w[,x]*15 ) You should learn the basics about how to extract or replace part of

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Anthony Hirst
I don't know the answer but here is the info for the ess list. ess-h...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help On Thu, Jul 26, 2018 at 11:26 AM Rich Shepard wrote: >I used to be subscribed to the ess SIG, but cannot find any saved > messages > from that

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
On Thu, 26 Jul 2018, Rich Shepard wrote: I was not aware of this I've always used a single # for comment everywhere that's the correct symbol. I'll try two of 'em. Reading the 17.11 user guide I see what #, ##, and ### do. I also put the suggested line to remove the fancy comments in

Re: [R] Breaking the samplesize package from CRAN

2018-07-26 Thread Bert Gunter
Suggest you contact the package maintainer. ?maintainer 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 Thu, Jul 26, 2018 at 9:49 AM, john

[R] Creatng new variable based upon conditions

2018-07-26 Thread JEFFERY REICHMAN
Given something like ... x <- c(3,2,4,3,5,4,3,2,4,5) y <- c("A","B","B","A","A","A","A","B","A","B") xy <- data.frame(x,y) xy$w <- ifelse(xy$y=="A",xy$w[,x]*10,xy$w[,x]*15 ) want to see x y w 1 3 A 30 2 2 B 30 3 4 B 60 4 3 A 30 5 5 A 50 6 4 A 40 7 3 A 30 8 2 B 30 9 4 A 40

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
On Thu, 26 Jul 2018, Marc Schwartz wrote: There is a reasonable chance that your ESS version, given its age, may be incompatible with some of the under the hood changes in Emacs since then, including changes to variable names, etc. Marc, The build script fails because it cannot find an

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
On Thu, 26 Jul 2018, jeremieju...@gmail.com wrote: Do you use single # or double hash ## when you comment? as far as i know there are 3 types of comment indentation on ESS. # ## ### In principle comment with # get centered. Jeremie, I was not aware of this I've always used a single # for

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Marc Schwartz via R-help
Rich, See inline below. Marc > On Jul 26, 2018, at 1:55 PM, Rich Shepard wrote: > > On Thu, 26 Jul 2018, Marc Schwartz wrote: > >> The full list of e-mail lists is here: >> https://stat.ethz.ch/mailman/listinfo/ >> and the ESS-Help list is here: >>

[R] Creatng new variable based upon conditions

2018-07-26 Thread JEFFERY REICHMAN
Given x <- c(3,2,4,3,5,4,3,2,4,5) y <- c("A","B","B","A","A","A","A","B","A","B") xy <- cbind(x,y) and am wanting to create a new variable "w" where if y=="A" then w==x*10 else w==x*15 such that I end up with a dataframe x y w [1,] 3 "A" 30 [2,] 2 "B" 30 [3,] 4 "B" 60 [4,] 3 "A"

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread jeremiejuste
Hello, I'm not sure I understand your question correctly but  I'll give it a try anyway. Do you use single # or double hash ## when you comment? as far as i know there are 3 types of comment indentation on ESS. # ## ### In principle comment with # get centered. Best regardsOn 26 Jul 2018

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
On Thu, 26 Jul 2018, Marc Schwartz wrote: The full list of e-mail lists is here: https://stat.ethz.ch/mailman/listinfo/ and the ESS-Help list is here: https://stat.ethz.ch/mailman/listinfo/ess-help which is also referenced on the ESS web site:

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Marc Schwartz via R-help
Hi Rich, The full list of e-mail lists is here: https://stat.ethz.ch/mailman/listinfo/ and the ESS-Help list is here: https://stat.ethz.ch/mailman/listinfo/ess-help which is also referenced on the ESS web site: http://ess.r-project.org/index.php?Section=getting%20help More than

Re: [R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
On Thu, 26 Jul 2018, Anthony Hirst wrote: I don't know the answer but here is the info for the ess list. ess-h...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help Anthony, Thanks! I thought that was the name but did not see it on the help page and didn't think of

[R] Breaking the samplesize package from CRAN

2018-07-26 Thread john matthew via R-help
Hello all, I am using the samplesize package (n.ttest function) to calculate number of samples per group power analysis (t-tests with unequal variance). I can break this n.ttest function from the samplesize package, depending on the standard deviations I input. This works very good. n.ttest(sd1

[R] ESS issue: lines moved right 40 spaces

2018-07-26 Thread Rich Shepard
I used to be subscribed to the ess SIG, but cannot find any saved messages from that list and I cannot find it in the list of mail lists on the r-project web site. So I'll ask here. Running ess-5.14 on emacs-25.3 I'm seeing a different behavior when I write scripts than I had seen in the

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
Harold, I don't have much experience with ODBC/RODBC, but given that it's working on Win, a driver problem seems plausible. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/26/18, 9:37 AM,

Re: [R] SQL Database

2018-07-26 Thread Doran, Harold
Thanks for this. I'm using the RODBC stuff now. It works well and is currently embedded in a shiny app. So, the entire SQL stuff is transparent to the user who simply interacts with the UI. It appears to be working in a local windows version. That is, I can successfully open the connection, do

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
From my point of view, the logic is this: If the external database is Oracle, use ROracle If the external database is MySQL, use RMySQL and similarly for other databases If there is no R package specific to the database, then you drop back to RODBC or RJDBC. Hopefully you can get the

Re: [R] Unable to Change Library Paths in R 3.5.1 in Windows 10

2018-07-26 Thread Jack Pincus
, it could be that there > is a missing newline on the last line.  If that is the case, then R > silently ignores that line. > > You might find the startup package helpful (disclaimer: I'm the > author); For (4), you can run startup::check() and it'll tell you and > fix potential issues li

Re: [R] Unable to Change Library Paths in R 3.5.1 in Windows 10

2018-07-26 Thread Leslie Rutkowski
ential issues like this one, e.g. > > > startup::check() > Backed up R startup file: ‘~/.Rprofile’ (29 bytes) -> > ‘~/.Rprofile.bak.20180726-122923’ (29 bytes) > Warning message: > In check_rprofile_eof(all = all, fix = fix, backup = backup, debug = > debug) : >

Re: [R] Unable to Change Library Paths in R 3.5.1 in Windows 10

2018-07-26 Thread Henrik Bengtsson
ine. You might find the startup package helpful (disclaimer: I'm the author); For (4), you can run startup::check() and it'll tell you and fix potential issues like this one, e.g. > startup::check() Backed up R startup file: ‘~/.Rprofile’ (29 bytes) -> ‘~/.Rprofile.bak.20180726-122923’ (29 byt

Re: [R] SQL Database

2018-07-26 Thread Martin Maechler
> Doran, Harold > on Wed, 25 Jul 2018 14:57:13 + writes: > I'm doing some work now to learn which SQL database > package is the most optimal for the task I am working on. Hmm... we would have a problem with optimize() and optim() if this was optimal << more