Re: [R] Extract

2024-07-19 Thread Robert Knight
I would split dat$string into it's own vector, break it apart at the spaces into an array, and then place dat$year and dat$sex in positions 1 and 2 of that newly created array. On Fri, Jul 19, 2024, 12:52 PM Val wrote: > Hi All, > > I want to extract new variables from a string and add it

Re: [R] What is the HEX code for "transparent" color?

2024-06-06 Thread Robert Knight via R-help
t -- 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. -- Robert Knight tel 270-306-1658 fax (270) 288-0474 r...@rk.fy

Re: [R] What is the HEX code for "transparent" color?

2024-06-06 Thread Robert Knight
You would give an existing color a new name and modify the new name's alpha. Then refer to the color by the new name instead of using HEX. On Thu, Jun 6, 2024, 11:07 AM Yosu Yurramendi wrote: > What is the HEX code for "transparent" color? > I've tried "" "FF00" "", but

[R] Huge differences in Ram Consumption with different versions of R on the same scripts

2023-05-07 Thread Robert Knight
? Robert Knight [[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

Re: [R] AIC

2022-11-25 Thread Robert Knight
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. > -- Robert Knight Developer

Re: [R] Date read correctly from CSV, then reformatted incorrectly by R

2021-11-22 Thread Robert Knight
Richard, This response was awe-inspiring. Thank you. -Original Message- From: R-help On Behalf Of Richard O'Keefe Sent: Sunday, November 21, 2021 8:55 PM To: Philip Monk Cc: R Project Help Subject: Re: [R] Date read correctly from CSV, then reformatted incorrectly by R CSV data is

Re: [R] Fwd: Merging multiple csv files to new file

2021-11-03 Thread Robert Knight
It might be easier to settle on the desired final csv layout and use Python to copy the rows via line reads. Python doesn't care about the data type in a given "cell", numeric or char, whereas the type errors R would encounter would make the task very difficult. On Wed, Nov 3, 2021, 10:36 AM

Re: [R] problem for strsplit function

2021-07-10 Thread Robert Knight
My method would be to use parse and deparse and substitute. It would iterate over each file name and build a new list of file names with the last four characters removed to have only the left side, and only the last four remaining to have only the right side. Then a new dataframe would be

Re: [R] Wayland backend for R

2021-06-23 Thread Robert Knight
Perhaps software rendering would work. Export RSTUDIO_CHROMIUM_ARGUMENTS="--disable-gpu" /usr/lib/rstudio/bin/rstudio On Wed, Jun 23, 2021, 10:01 AM Phillips Rogfield wrote: > Hello Paul, > > thank you for your kind advice. > > RStudio doesn't start at all this way. It gives me the following

Re: [R] CentOS 8: installing R

2021-05-25 Thread Robert Knight
Openblas-threads is in the appstream repository rather than power tools. https://centos.pkgs.org/8/centos-appstream-x86_64/openblas-threads-0.3.3-5.el8.x86_64.rpm.html On Mon, May 24, 2021, 2:56 PM Marc Schwartz via R-help wrote: > Hi Roger, > > I can't speak to the details here, albeit, there

Re: [R] Variable labels

2021-05-15 Thread Robert Knight
Actually, I just found exactly what you want. Before that though, I am having a hard time finding any such cool job despite having even had classes with some great professors in economics at UND, and so I work in a completely non data related thing. Here is exactly what you want, code included.

Re: [R] Variable labels

2021-05-15 Thread Robert Knight
Hi Steven, You make great sense wanting to have labels for your variables. When in RStudio, the little arrow beside "mydata" in the Environment tab can be clicked and you see all the variables there. And so you would like to see a description under the variable names. Here is one way to

Re: [R] Is there anyone who uses both R and Python here? How do you debug? Perhaps in RStudio?

2021-01-27 Thread Robert Knight
An iterative process works well. Python to get the data desired and then Rscript script.r from a command line. My process involves building a script in R using, using Rstudio, Pycharm, VS Code, Kate, or some other editor. Then using data input built with Python as input to Rscript. The R

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

Re: [R] Can anyone advise me on running R and Rstudio on an AWS virtual machine

2020-10-14 Thread Robert Knight
server gets hacked in some fashion. You could restrict access to your own IP address in the AWS security group settings which would drastically minimize the risk of that. Robert Knight > On Oct 14, 2020, at 12:00 PM, Chris Evans wrote: > > This is a funny one and if it's off topi

[R] Some R code works on Linux, but not Linux via Windows Subsystem Linux

2020-09-08 Thread Robert Knight
RE: Some R code works on Linux, but not Linux via Windows Subsystem Linux This is taking data from a CSV and placing it into a data frame. This is R 3.6.3 inside Windows Subsystem for Linux v2, Ubuntu 18.04. The exact same code, unchanged and on the same computer, works correctly in Ubuntu

Re: [R] Error trapping in R

2019-02-28 Thread Robert Knight
Some use try blocks, like found in other languages. Put the code you want to try inside the block. https://www.robertknight.io/blog/try-blocks-in-r-for-error-handling/ contains a quick example. The example doesn’t raise exceptions or anything, it just contains it for you so the script keeps