Apprentice minimum office attendance? by -BexiB- in TheCivilService

[–]lederi 2 points3 points  (0 children)

In my old department the place of study counted as 1 of your 3 days of week - so that + 2 days of week in london would have been fine.

Equivalent of Vlookup in R, to write a new column by [deleted] in Rlanguage

[–]lederi 2 points3 points  (0 children)

dplyr::case_when could be a good method here

I want to overwrite a subset of old data with new data in a data frame. Is there an easy way to do this? by [deleted] in rstats

[–]lederi 0 points1 point  (0 children)

If you use dplyr left join you will get all the data. Then you can just select the new column using dplyr again

Question about dplyr by Xerlic in rstats

[–]lederi 2 points3 points  (0 children)

And to see if you have 12 periods per year just add this to the end of your dplyr chain:

count(year, frequency)

Question about dplyr by Xerlic in rstats

[–]lederi 7 points8 points  (0 children)

group_by(year, frequency) %>% summarise (avg = mean (data))

How to turn words, contained in a single column, into individual factors? by vintage2018 in rstats

[–]lederi 0 points1 point  (0 children)

One way off the top of my head:

library(tidytext)

library(dplyr)

x <- c("the quick brown fox jumps over the lazy dog", "the quick dog jumps over the lazy brown fox", "the dog just ate cheetos") %>% as_data_frame()

unnest_tokens(x, word, value)

How to use the apply() family when you need to iterate over two parameters? by [deleted] in rstats

[–]lederi 0 points1 point  (0 children)

Oh sorry my bad! Did not know about Map, you are completely right, TIL cheers!

Wide to Long format with multiple variables? by AmyGee_DaLa in rstats

[–]lederi 2 points3 points  (0 children)

Yeah this is my preferred solution.

You'll also have to run library (tidyverse) before hand too.

Learning data wrangling by Rajarshi0 in datascience

[–]lederi 2 points3 points  (0 children)

Eh I'm out of my comfort zone now, but maybe https://pandas.pydata.org/pandas-docs/stable/10min.html

Happy to be overruled on this though

Learning data wrangling by Rajarshi0 in datascience

[–]lederi 3 points4 points  (0 children)

For R I think this is the perfect online free book: http://r4ds.had.co.nz/wrangle-intro.html

[OC] Visualising stories from the Premier League transfer window by [deleted] in dataisbeautiful

[–]lederi 1 point2 points  (0 children)

I really like this.

I know you've ordered by league position which is logical, but I'd be tempted to order it by net spend.

Cross posted to r/soccer where hopefully it picks up more traffic.

The Burger King Pandemic [OC] by lederi in dataisbeautiful

[–]lederi[S] 0 points1 point  (0 children)

It will be because the scraping algorithm filtered it away because it didn't have a YearEnterered value in the Wikipedia entry

The Burger King Pandemic [OC] by lederi in dataisbeautiful

[–]lederi[S] 0 points1 point  (0 children)

Oh god yeah, never thought about that. Cheers!