🫤 Unfortunately, I was affected by last week's layoffs at @Posit along with a handful of other talented colleagues.
🖤 I’m bummed, but so grateful for the 5½+ yrs w/ my incredible team.
🔍 Taking some time to recoup, but will be on the hunt for new opportunities soon!
@dataandme@Posit I'm so sorry to hear that Mara,I loved your community building and engagement. I was an R user before but thanks to one of your Retweets/comments I found the #rstats community.
That was a great #rstats@rstats history talk, putting the development of the S language that was revolutionary at its time in 1970s, and the open source port of it in 1980s. Help to understand the roots.
💪Very informal, friendly and supportive 'show and tell' - would be lovely if you're willing to share something R-related you've been working on or like (not obligatory).
@abhi@mikelech I think of it as more of a chef's knife for R and less of a Swiss Army Knife for several languages. Yes, both work with R and I use both VSCode(ium) and RStudio, but I still gravitate to RStudio for my R work... #RStats#RStudio
@mikelech@abhi Sorry for jumping in, I don't wanna be "that guy", but have you considered giving Emacs a try? #ESS (Emacs Speaks Statistics) is the mode (i.e extension) that provide #Rstats and #Julia development features (syntax highlughting, debugging, repl, completion, ...). This way you have one program (Emacs) with one set of keybindings and theme and ... with which you can work with R, Julia, notebooks, ... and in GUI or in terminal, local or remote. https://ess.r-project.org
When I read R code and see people have very liberally used tons of packages like there is no tomorrow, I cringe. This is bad when they are doing it in research. Basically what they are doing is addicting their analysis and research to tons of packages. Like any other addition, when they don't get their fix, it's gonna hurt, and gonna hurt bad. Their research's reproducibility is close to non-existence as none of those packages will be around for ever. Pick dependencies carefully.
@LeafyEricScott@Mehrad Yeah. "Do one thing and do it well" implies using lots of packages. Leveraging the awesome #RStats community is good. Otherwise, just dismantle CRAN, retire all packages and write code like an elderly recluse in a cave.
@Mehrad@LeafyEricScott Your tone ('wannabees "data scientists"', 'lazy') is extremely gatekeepy and toxic. People in the #RStats community have different experiences, levels of expertise, and needs. This demeaning language has no place in our community.
Dear #rstats community, I have a problem.
I have a df with multiple char columns which I want to coerce to factors and a list of pre-defined factor level orders (vectors) that I want to apply in the process. Now apparently this isn't a wide-spread thing to do. I am using #tidyverse code.
My approach of
df <- df |> mutate(across(all_of(charvars), ~factor(., levels= levellist[[which(factors==cur_column())]]))
throws me an error telling me it "cant compute the first column ("who")" followed by "internal error"...backtrace attached. My problem is: I used the same approach literally 3 lines above on different subsets before and it works!
I've been playing a bit more with #MicrosoftExcel these days
Although #Excel shouldn't be used to analyze data (don't use spreadsheet apps to analyze data, use #Rstats or an equivalent instead), Excel is by contrast very useful to store data in an organized way
Occasionally, I think about how to work effectively with #rstats. Currently, I am teaching my #bioinformatics courses with #RKWard again. I try to do most of it with packages from the base installation. #datatable is an exception. But otherwise, I like to use #within (very fast) instead of #mutate.
But there are more approaches, which are often simpler/faster/stable:
@magljo I used to use Rkward before starting Rstudio. It is a good spftware and has almost everything one need. I even have it always installed along with Rstudio. The only things that it does not have and I desperately need is being able to run it remotely. I use Rstudio server and Emacs for remote work in #rstats . I can say that Rstudio server is way more stable if TCP ports can be opened and accessed through firewall, otherwise i just use Emacs' ESS and Tramp.
#Rstats thing I learned today: writing functions using pipes and tidyverse code needs special indexing of paremeterized columns
For example: If you want to index a column via a function parameter within
myfun <- function(data, param){
}
and param is used to index a column of a df or tibble, you need to index it with double curly brackets like this inside functions:
data |> mutate(new_var = mean({{param}}))
The reason: strings do not work, computed columns do not work.Your indexing tricks like square brackets or dollar notation do not work. The curly brackets enable function input similar to object notation without quotation marks. They translate your variable to the correct namespace
Do you want to take a random sample of your data in R?
Here are some examples of how you can use sample():
✔ Generate a random permutation of the elements of a vector.
✔ Select a random subset of a dataset.
✔ Generate a random sample of data for testing purposes.
✔ Create a bootstrap sample.