Re: [R] Language environment

2020-11-17 Thread Steven Yen
Thanks. YES, include the line Sys.setenv(LANG="en"); in my Rprofile file and it worked. On 2020/11/18 上午 12:43, Jeff Newmiller wrote: put it in your .Rprofile file. Read the R Installation and Administration Manusl for more info. On November 17, 2020 5:00:06 AM PST, Steven Yen wrote: In R,

Re: [R] How to pass a character string with a hyphen

2020-11-17 Thread Jeff Reichman
Robert I ended up using the paste command, its not pretty but it works thank you Jeff From: Robert Knight Sent: Tuesday, November 17, 2020 3:56 PM To: reichm...@sbcglobal.net Cc: r-help@r-project.org Subject: Re: [R] How to pass a character string with a hyphen Strip the left char

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Bert Gunter
z <- with(Data2, tapply(Vendor,Account, I)) n <- vapply(z,length,1) data.frame (Vendor = unlist(z), Account = rep(names(z),n), NumVen = rep(n,n) ) ## which gives: Vendor Account NumVen A1 V1 A1 1 A21 V2 A2 3 A22 V3 A2 3 A23 V1 A2 3

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Avi Gross via R-help
Many problems can often be solved with some thought by using the right tools, such as the ones from the tidyverse. Without giving a specific answer, you might want to think about using the group_by() functionality in a pipeline that would lump together all rows matching say having the same valu

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Bert Gunter
Why 0's in the data frame? Shouldn't that be 1 (vendor with that account)? 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 Tue, Nov 17, 2020 at 3:29 PM Tom

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Tom Woolman
Yes, good catch. Thanks Quoting Bert Gunter : Why 0's in the data frame? Shouldn't that be 1 (vendor with that account)? 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"

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Tom Woolman
Hi Bill. Sorry to be so obtuse with the example data, I was trying (too hard) not to share any actual values so I just created randomized values for my example; of course I should have specified that the random values would not provide the expected problem pattern. I should have just used s

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Bill Dunlap
What should the result be for Data1 <- data.frame(Vendor=c("V1","V2","V3","V4"), Account=c("A1","A2","A2","A2")) ? Must each vendor have only one account? If not, what should the result be for Data2 <- data.frame(Vendor=c("V1","V2","V3","V1","V4","V2"), Account=c("A1","A2","A2","A2","A3","A4

Re: [R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Bert Gunter
Inline. 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 Tue, Nov 17, 2020 at 1:20 PM Tom Woolman wrote: > Hi everyone. I have a dataframe that is a collectio

Re: [R] Inappropriate color name

2020-11-17 Thread Bernard Comcast
If the word Indian refers to India, the place of origin for the color, then referring to it by this name gives an acknowledgement to this fact and I would have assumed such acknowledgement is a positive thing. Bernard Sent from my iPhone so please excuse the spelling!" > On Nov 17, 2020, at 4:

Re: [R] Inappropriate color name

2020-11-17 Thread Boris Steipe
I would not be optimistic about a change - the naming scheme is a community standard, and the community is VERY large; this scheme is employed in thousands of software assets. Ultimately it goes back to X11 color naming in the eighties. See: https://en.wikipedia.org/wiki/X11_color_names for deta

Re: [R] Inappropriate color name

2020-11-17 Thread Spencer Graves
Might it be appropriate to raise that question on the Talk page associated with the Wikipedia article on "Indian red (color)": https://en.wikipedia.org/wiki/Indian_red_(color) Many Wikimedian are generally sympathetic to discussions of political correctness and similar topics. I

Re: [R] How to pass a character string with a hyphen

2020-11-17 Thread Robert Knight
Strip the left characters and strip the right characters into their own variables using one of the methods that can do that. Then pass it using something like paste(left, "-", right). On Tue, Nov 17, 2020, 2:43 PM Jeff Reichman wrote: > R-Help > > > > How does one pass a character string contai

Re: [R] Inappropriate color name

2020-11-17 Thread Mitchell Maltenfort
What about just amputating the final "n?" "Indian" might mean one of two things, but "India" is pretty distinct. On Tue, Nov 17, 2020 at 4:10 PM T. A. Milne via R-help wrote: > > Apologies to the list for continuing a thread which is clearly off-topic. > However, contacting the maintainer of

Re: [R] How to pass a character string with a hyphen

2020-11-17 Thread Marc Schwartz via R-help
Hi, You might want to look at ?shQuote, which wraps text in single quotes, if the source text does not include them, or double quotes otherwise, as might be used in a shell setting, where you are passing arguments that may have spaces or other characters that may be evaluated. My guess is that

Re: [R] How to pass a character string with a hyphen

2020-11-17 Thread Jeff Reichman
Boris Yes in that case it works as you have assigned a character string to key. My problem is I'm taking a string input from a shiny app and when I run the function it only sees . How to assign - to a character string. Jeff -Original Message- From: Boris Steipe Sent: Tuesda

[R] counting duplicate items that occur in multiple groups

2020-11-17 Thread Tom Woolman
Hi everyone. I have a dataframe that is a collection of Vendor IDs plus a bank account number for each vendor. I'm trying to find a way to count the number of duplicate bank accounts that occur in more than one unique Vendor_ID, and then assign the count value for each row in the dataframe

Re: [R] Inappropriate color name

2020-11-17 Thread T. A. Milne via R-help
Apologies to the list for continuing a thread which is clearly off-topic.  However, contacting the maintainer of an R package to complain about this specific color name seems ill-considered. 1)  The name "indian red" is a part of widely-used color schemes everywhere, not just in R.  It's the

Re: [R] How to pass a character string with a hyphen

2020-11-17 Thread Boris Steipe
tmp <- function(s) { return(str(s)) } key <- "-" tmp(key) # chr "-" ... works for me. Reprex? Cheers, Boris __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] How to pass a character string with a hyphen

2020-11-17 Thread Jeff Reichman
R-Help How does one pass a character string containing a hyphen? I have a function that accesses an api if I hard code the object, for example key_key <- "-" it works but when I pass the key code to the function (say something like key_code <- code_input) it returns only

Re: [R] Using multiroot for root solution for a matrix based function

2020-11-17 Thread Berend Hasselman
Forgot to send this to R-help. You have already asked this question on stackoverflow (https://stackoverflow.com/questions/64835251/how-can-i-use-multiroot-with-matrix-based-functions-in-r/64835725#64835725). In a comment G. Grothendieck provided an answer. Have you tried it? Define a funct

Re: [R] Inappropriate color name

2020-11-17 Thread Derek Ogle
I agree with, support, and appreciate this message. Thank you Ryan for the courage to write this, and Lainey for your courage to persist with your question. -Original Message- From: R-help On Behalf Of Ryan Novosielski Sent: Tuesday, November 17, 2020 9:40 AM To: r-help mailing list Cc

Re: [R] Inappropriate color name

2020-11-17 Thread Chris Evans
... and we are off topic and I'm not sure I would vote for changing the name of the colour but at the same time I have to endorse that as a brilliant, brilliant summary of the issues which ought to be a fortune candidate. I have cc'd in the noble Achim, maintainer of the cookies package as I s

Re: [R] Language environment

2020-11-17 Thread Jeff Newmiller
put it in your .Rprofile file. Read the R Installation and Administration Manusl for more info. On November 17, 2020 5:00:06 AM PST, Steven Yen wrote: >In R, I was able to set the language environment by fixing the line > >in file "C:\Program Files\R\R-4.0.3\etc\Rconsole", line 70 below, set >l

Re: [R] Inappropriate color name

2020-11-17 Thread Ryan Novosielski
> On Nov 16, 2020, at 5:46 PM, Rolf Turner wrote: > > On Tue, 17 Nov 2020 07:54:01 +1100 > Jim Lemon wrote: > >> Hi Elaine, >> There seems to be a popular contest to discover offence everywhere. I >> don't think that it does anything against racism, sexism or >> antidisestablishmentarianism. Wo

[R] Using multiroot for root solution for a matrix based function

2020-11-17 Thread quinter sam
I have a function which is actually an output of another function and I therefore cannot change it. I am trying to use *multiroot * from package *rootSolve * to compute the roots of the function but its not working at all. Is there something I am not seeing or is there another alternative that is

Re: [R] Inappropriate color name

2020-11-17 Thread T. A. Milne via R-help
On Tue, 17 Nov 2020 07:54:01 +1100Jim Lemon wrote: > Hi Elaine,There seems to be a popular contest to discover offence everywhere. > Idon't think that it does anything against racism, sexism > orantidisestablishmentarianism. Words are plucked from our vast lexic

[R] WG: grouped anova from lm as data frame, tidyr broom

2020-11-17 Thread Kluth, Christian
Dear R-project team, I got a message that the e-mail from this morning was filtered away completely. So hopefully this is working. I am trying to solve a probably easy problem with R using the tidyr package. Probably I did not get the concept very clearly. I would like to get a nice tidy data fra

[R] Request for help to modify sliderInput in RShiny app (conditional statement)

2020-11-17 Thread Bhaskar Mitra
Hello Everyone, I have written certain codes in RShiny app which works fine. There are 3 tabs, "Z1", "Z2" and "Z3". Currently the sliderinput shows up when I click all the 3 tabs. I need to adjust this code so that sliderInput is only visible when i click tab "Z1" and not for tabs "Z2" and "Z3

Re: [R] Inappropriate color name

2020-11-17 Thread Mitchell Maltenfort
Thanks, Rolf, I never saw the Letter to Chesterfield myself. Though I admit I run more to Swift's "A Modest Proposal" but then if you really want to get into being impolitic that's a stellar example! Mitch On Mon, Nov 16, 2020 at 5:46 PM Rolf Turner wrote: > > On Tue, 17 Nov 2020 07:54:01 +110

Re: [R] Language environment

2020-11-17 Thread Marc Schwartz via R-help
> On Nov 17, 2020, at 8:00 AM, Steven Yen wrote: > > In R, I was able to set the language environment by fixing the line > > in file "C:\Program Files\R\R-4.0.3\etc\Rconsole", line 70 below, set > language to EN: > > language = EN > > In RStudio, I am not able to do that, except to include

Re: [R] Language environment

2020-11-17 Thread stephen sefick
Maybe in .Rprofile? Maybe in .first in .Rprofile? Stephen Sefick, PhD On Tue, Nov 17, 2020, 08:01 Steven Yen wrote: > In R, I was able to set the language environment by fixing the line > > in file "C:\Program Files\R\R-4.0.3\etc\Rconsole", line 70 below, set > language to EN: > > language = EN

[R] Language environment

2020-11-17 Thread Steven Yen
In R, I was able to set the language environment by fixing the line in file "C:\Program Files\R\R-4.0.3\etc\Rconsole", line 70 below, set language to EN: language = EN In RStudio, I am not able to do that, except to include the line Sys.setenv(LANG="en"); in every one of my program file. That

Re: [R] WG: Packegs for mathematics

2020-11-17 Thread Michael Dewey
Dear Mihaela As well as the search tips you have been given you may want to look at the CRAN Task Views. There is one for Multivariate https://cran.r-project.org/view=Multivariate and one for NumericalMathematics https://cran.r-project.org/view=NumericalMathematics and several others which may

Re: [R] Packegs for mathematics

2020-11-17 Thread Boris Steipe
You really don't need to worry about all those packages in the beginning. Base R has all of the functionality you need to get you started. Then, when you actually need additional functions, you can search for this functionality on the Web, on CRAN, by asking on this helpful list, or on your favo