[R] Barplot for data frame
I have a dataframe df <- df <- data.frame (Revenue = c("100", "300", "500"), Brand = c("Apple", "HP", "Lenovo") ) how can i create a vertical barplot that displays brands in x-axis and Revenue in Y-axis [[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] Barplot for data frame
Look like homework to me :-)-O el On 2023-11-29 02:29 , Livio Beqiri wrote: I have a dataframe df <- df <- data.frame (Revenue = c("100", "300", "500"), Brand = c("Apple", "HP", "Lenovo") ) how can i create a vertical barplot that displays brands in x-axis and Revenue in Y-axis [[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] Barplot for data frame
В Wed, 29 Nov 2023 00:29:49 + Livio Beqiri пишет: > how can i create a vertical barplot that displays brands in x-axis > and Revenue in Y-axis What have you tried? If you're not currently studying R with an instructor (who should be contacted with basic questions like this instead; see the posting guide at [1]), I can recommend a free book by A. Shipunov [2] to give you the basic R knowledge. > df <- data.frame (Revenue = c("100", "300", "500"), > Brand = c("Apple", "HP", "Lenovo") > ) My psychic debugging powers tell me that you're getting an error complaining about the wrong argument type. If that's the case, you should either avoid quoting your numbers (i.e. say 100 instead of "100") or transform the character vector into a vector of numbers using as.numeric(). Either way, it's best to show your work and your error messages because the psychic debugging powers don't always work properly. -- Best regards, Ivan [1] https://www.r-project.org/posting-guide.html [2] https://web.archive.org/web/20230501112111/http://ashipunov.info/shipunov/school/biol_240/en/visual_statistics.pdf __ 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] computer algebra in R
Dear Konrad, I presume that the system can be written as follows, where h0, d0, ga0, kga and kd are given: err1 = h + hd + hga - h0; err2 = d + hd - d0; err3 = ga + hga - ga0; err4 = hga - kga*h*ga; err5 = hd - kd*h*d; All error terms should be zero. Do you need (a) the symbolic solution or (b) is a numeric solution fine? I do not have any experience with yacas or caracas. But see below. ### Case (a) I did write a (very rudimentary) symbolic solver for systems of polynomial equations in pure R. It should be able to solve this one. Please let me know if this is of interest and I will provide further details. ### Case (b) Again, it should be possible to solve, see some examples: https://github.com/discoleo/R/blob/master/Math/Systems.NLE.Tutorial.md https://github.com/discoleo/R/blob/master/Math/Systems.Lambert.R I did solve much more complex ones, for a monster see: https://github.com/discoleo/R/blob/master/Math/Poly.System.S5.Ht.Formulas.Derivation.HS0.R [and the remaining Poly.System.S5.Ht... scripts] I presume that only the real roots are required (it's possible to solve systems with complex roots as well). I can provide further details as well. Sincerely, Leonard [[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] Barplot for data frame
Another great resource is RSeek.org https://rseek.org/?q=barplot On Wed, Nov 29, 2023 at 4:26 AM Ivan Krylov wrote: > В Wed, 29 Nov 2023 00:29:49 + > Livio Beqiri пишет: > > > how can i create a vertical barplot that displays brands in x-axis > > and Revenue in Y-axis > > What have you tried? If you're not currently studying R with an > instructor (who should be contacted with basic questions like this > instead; see the posting guide at [1]), I can recommend a free book by > A. Shipunov [2] to give you the basic R knowledge. > > > df <- data.frame (Revenue = c("100", "300", "500"), > > Brand = c("Apple", "HP", "Lenovo") > > ) > > My psychic debugging powers tell me that you're getting an error > complaining about the wrong argument type. If that's the case, you > should either avoid quoting your numbers (i.e. say 100 instead of > "100") or transform the character vector into a vector of numbers using > as.numeric(). > > Either way, it's best to show your work and your error messages because > the psychic debugging powers don't always work properly. > > -- > Best regards, > Ivan > > [1] > https://www.r-project.org/posting-guide.html > > [2] > > https://web.archive.org/web/20230501112111/http://ashipunov.info/shipunov/school/biol_240/en/visual_statistics.pdf > > __ > 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.
[R] Code editor for writing R code
Hi, Currently I use VS-Code to write codes in R. While it is very good, it does not allow me to write Latex expressions in comments, which I am willing to have to write corresponding mathematical expressions as comments in my code files. Does there exist any Code editor for R, that allows me to write Latex in comments? Any information will be appreciated. Thanks, __ 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] Code editor for writing R code
Presumably there's nothing stopping you *writing* LaTeX in comments -- do you want a code editor that will render and display the LaTeX as you write? (Or am I misunderstanding something?) Does anyone do classic literate programming *sensu* Knuth any more? https://rpubs.com/bbolker/3153 https://cran.r-project.org/web/packages/noweb/vignettes/noweb.pdf On 2023-11-29 10:57 a.m., Christofer Bogaso wrote: Hi, Currently I use VS-Code to write codes in R. While it is very good, it does not allow me to write Latex expressions in comments, which I am willing to have to write corresponding mathematical expressions as comments in my code files. Does there exist any Code editor for R, that allows me to write Latex in comments? Any information will be appreciated. Thanks, __ 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] Code editor for writing R code
Another direction would be to replace your R script (.R file) with a Quarto document (.qmd file). VS-code has good support for Quarto and you could intersperse your Latex with R chunks. On Wed, Nov 29, 2023 at 6:15 PM Ben Bolker wrote: > > > >Presumably there's nothing stopping you *writing* LaTeX in comments > -- do you want a code editor that will render and display the LaTeX as > you write? (Or am I misunderstanding something?) > >Does anyone do classic literate programming *sensu* Knuth any more? > https://rpubs.com/bbolker/3153 > https://cran.r-project.org/web/packages/noweb/vignettes/noweb.pdf > > > On 2023-11-29 10:57 a.m., Christofer Bogaso wrote: > > Hi, > > > > Currently I use VS-Code to write codes in R. While it is very good, it > > does not allow me to write Latex expressions in comments, which I am > > willing to have to write corresponding mathematical expressions as > > comments in my code files. > > > > Does there exist any Code editor for R, that allows me to write Latex > > in comments? > > > > Any information will be appreciated. > > > > Thanks, > > > > __ > > 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] Code editor for writing R code
I believe RMarkdown can use and render latex comments. RStudio/Posix provides ide extensions (e.g. R Notebooks) that seem to do what you want, but I have no experience with them. As Ben suggested, there are likely others, depending on exactly what you want to do. -- Bert On Wed, Nov 29, 2023 at 7:58 AM Christofer Bogaso wrote: > > Hi, > > Currently I use VS-Code to write codes in R. While it is very good, it > does not allow me to write Latex expressions in comments, which I am > willing to have to write corresponding mathematical expressions as > comments in my code files. > > Does there exist any Code editor for R, that allows me to write Latex > in comments? > > Any information will be appreciated. > > Thanks, > > __ > 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] Code editor for writing R code
This might be of use to you: https://everyday.codes/tutorials/how-to-use-latex-in-rmarkdown/ -- Bert On Wed, Nov 29, 2023 at 8:21 AM Bert Gunter wrote: > > I believe RMarkdown can use and render latex comments. RStudio/Posix > provides ide extensions (e.g. R Notebooks) that seem to do what you > want, but I have no experience with them. As Ben suggested, there are > likely others, depending on exactly what you want to do. > > -- Bert > > On Wed, Nov 29, 2023 at 7:58 AM Christofer Bogaso > wrote: > > > > Hi, > > > > Currently I use VS-Code to write codes in R. While it is very good, it > > does not allow me to write Latex expressions in comments, which I am > > willing to have to write corresponding mathematical expressions as > > comments in my code files. > > > > Does there exist any Code editor for R, that allows me to write Latex > > in comments? > > > > Any information will be appreciated. > > > > Thanks, > > > > __ > > 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] Code editor for writing R code
Hi Sergei, Where can I find TeX Comments extension in VS Code? On Wed, Nov 29, 2023 at 9:34 PM Sergei Ko wrote: > > TeX Comments extension in VS Code > > > > > Sent from my phone > > > Original message > From: Christofer Bogaso > Date: Wed, 29 Nov 2023, 15:57 > To: r-help > Subject: [R] Code editor for writing R code > > Hi, > > Currently I use VS-Code to write codes in R. While it is very good, it > does not allow me to write Latex expressions in comments, which I am > willing to have to write corresponding mathematical expressions as > comments in my code files. > > Does there exist any Code editor for R, that allows me to write Latex > in comments? > > Any information will be appreciated. > > Thanks, > > __ > 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] Code editor for writing R code
Bert, Posit (formerly RStudio) has moved from RMarkdown to Quarto. They still support RMarkdown but major new features will be in Quarto. For new users a better choice would be Quarto. See https://quarto.org/docs/faq/rmarkdown.html Secondly, the OP stated he was using the VS-Code IDE, so there is no reason to point him to the Posit/RStudio IDE for this functionality which VS-Code supports very well (as I noted in my response.) Best, Eric On Wed, Nov 29, 2023 at 6:55 PM Christofer Bogaso wrote: > > Hi Sergei, > > Where can I find TeX Comments extension in VS Code? > > On Wed, Nov 29, 2023 at 9:34 PM Sergei Ko wrote: > > > > TeX Comments extension in VS Code > > > > > > > > > > Sent from my phone > > > > > > Original message > > From: Christofer Bogaso > > Date: Wed, 29 Nov 2023, 15:57 > > To: r-help > > Subject: [R] Code editor for writing R code > > > > Hi, > > > > Currently I use VS-Code to write codes in R. While it is very good, it > > does not allow me to write Latex expressions in comments, which I am > > willing to have to write corresponding mathematical expressions as > > comments in my code files. > > > > Does there exist any Code editor for R, that allows me to write Latex > > in comments? > > > > Any information will be appreciated. > > > > Thanks, > > > > __ > > 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] Code editor for writing R code
Quarto is built on top of RMarkdown when R is used, so RMarkdown isn't going anywhere soon. Don't spread unnecessary FUD. Quarto is well-supported in VSCode, though. And reply to the right branch of the thread... Bert is not in the thread below. On November 29, 2023 10:29:03 AM PST, Eric Berger wrote: >Bert, >Posit (formerly RStudio) has moved from RMarkdown to Quarto. They >still support RMarkdown but major new features will be in Quarto. For >new users a better choice would be Quarto. >See https://quarto.org/docs/faq/rmarkdown.html > >Secondly, the OP stated he was using the VS-Code IDE, so there is no >reason to point him to the Posit/RStudio IDE for this functionality >which VS-Code supports very well (as I noted in my response.) > >Best, >Eric > >On Wed, Nov 29, 2023 at 6:55 PM Christofer Bogaso > wrote: >> >> Hi Sergei, >> >> Where can I find TeX Comments extension in VS Code? >> >> On Wed, Nov 29, 2023 at 9:34 PM Sergei Ko wrote: >> > >> > TeX Comments extension in VS Code >> > >> > >> > >> > >> > Sent from my phone >> > >> > >> > Original message >> > From: Christofer Bogaso >> > Date: Wed, 29 Nov 2023, 15:57 >> > To: r-help >> > Subject: [R] Code editor for writing R code >> > >> > Hi, >> > >> > Currently I use VS-Code to write codes in R. While it is very good, it >> > does not allow me to write Latex expressions in comments, which I am >> > willing to have to write corresponding mathematical expressions as >> > comments in my code files. >> > >> > Does there exist any Code editor for R, that allows me to write Latex >> > in comments? >> > >> > Any information will be appreciated. >> > >> > Thanks, >> > >> > __ >> > 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. -- Sent from my phone. Please excuse my brevity. __ 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] Code editor for writing R code
On 29/11/2023 1:29 p.m., Eric Berger wrote: Bert, Posit (formerly RStudio) has moved from RMarkdown to Quarto. They still support RMarkdown but major new features will be in Quarto. For new users a better choice would be Quarto. See https://quarto.org/docs/faq/rmarkdown.html I'm not sure about that advice. Quarto has some bad design choices. For example, these lines: https://github.com/quarto-dev/quarto-cli/blob/3c9950947871ceafa54de909b15077cd54e27efe/src/resources/rmd/patch.R#L159-L184 have them faking S3 dispatch, but doing it really badly. They worked around an issue I reported last year (https://github.com/quarto-dev/quarto-cli/issues/1800), but with a design like that, there will be other issues. Secondly, the OP stated he was using the VS-Code IDE, so there is no reason to point him to the Posit/RStudio IDE for this functionality which VS-Code supports very well (as I noted in my response.) The original question did ask for recommendations for a different editor. Duncan Murdoch Best, Eric On Wed, Nov 29, 2023 at 6:55 PM Christofer Bogaso wrote: Hi Sergei, Where can I find TeX Comments extension in VS Code? On Wed, Nov 29, 2023 at 9:34 PM Sergei Ko wrote: TeX Comments extension in VS Code Sent from my phone Original message From: Christofer Bogaso Date: Wed, 29 Nov 2023, 15:57 To: r-help Subject: [R] Code editor for writing R code Hi, Currently I use VS-Code to write codes in R. While it is very good, it does not allow me to write Latex expressions in comments, which I am willing to have to write corresponding mathematical expressions as comments in my code files. Does there exist any Code editor for R, that allows me to write Latex in comments? Any information will be appreciated. Thanks, __ 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.