Learncado
Learncado

Learncado brings together a vast collection of questions and answers. Expand your knowledge, learn new skills, and find solutions to your queries effortlessly. Enhance your learning experience and save valuable time by exploring our website today.

Resources

  • Questions
  • Question By Tags

Help and support

  • Contact
  • About

  • Geniecourse
  • Jetsodeals
  • Rentcado
  • Dealcado
© 2021-2023 Learncado All Rights Reserved.

Search Results (54)

Results for dplyr

December 1st, 2023
dplyr: Return values from multiple columns to a new column where the last character in column names == last character of values in reference column

I'm needing a more flexible method to extract values from multiple columns into column "y" where the last character in "x" == the last character of th...

rdplyr
Read more
November 27th, 2023
Passing dplyr methods as function arguments

I have a general piece of code A that comes up repeatedly in a series of programs. Each instance of A assumes the form output_data = input_data %>% ...

rdplyrfunction
Read more
November 26th, 2023
join_by data-masking in dplyr in R

How can I index to an ith column within join_by a .frame( a.1= 1:4 ) b .frame( b.1= 1:4 ) inner_join( a, b, by= join_by( x$a.1 $b.1 ) Suppose we are u...

rdplyr
Read more
November 23rd, 2023
How include zeros when using count() + dplyr

The code I've got so far works fine, but I want to include in the output certain Majors with zero count. Having read around it looks like the solution...

rdplyr
Read more
November 19th, 2023
New group ID when value changes from positive to negative using dplyr

Searched SO and surprised I couldn't find a solution, hopefully not a duplicate. And perhaps this is more a logic question rather than an R question p...

rdplyr
Read more
November 19th, 2023
`dplyr::arrange()` is not accurate with foreign language text: is it operator-error or the function? `sort()` does it correctly

When using dplyr::arrange() with Greek text, it does not order the data correctly. Here's an example: library(dplyr) wds "θέση", "ταχυδρομείο", "γραμ...

rdplyr
Read more
November 12th, 2023
tidy evaluation in dplyr vs base r functions

i tried to summarise the data in dplyr vs base r functions but dont get the expected result, please let me know why for example i tried the string as ...

r
Read more
November 11th, 2023
R dplyr purrr error when passing dataframe to pmap_dfr()

I'm preparing a function to graph trigonometric functions. I have written a function which successfully returns the correct value when given the param...

rpurrrpmap
Read more
November 6th, 2023
dplyr::mutate() with ifelse() function

I'm trying to create a new column in a dataframe with dplyr::mutate(). There are two cases for the column the data is taken from: The original column...

regexrdplyr
Read more
October 27th, 2023
Creating a multi-density chart with two variables using dplyr

So I am looking to create a density plot using a binary grouping variable. See the data below but the x axis is each numeric interval from 0-4, the y ...

rdplyrggplot2
Read more
October 25th, 2023
How to conditionally fill a cell based on two conditions in R using dplyr

I've done this in Base a bunch by manually entering the conditions that need to be met in order to set a new value of a new cell, but I really want to...

rdplyr
Read more
September 28th, 2023
Using R dplyr mutate to create a factor column using pre-declared levels

I've written R code to produce a periodic report that requires re-ordering of Week numbers such that I can filter and order by the most recent 10 week...

rdplyrmutatefactors
Read more
September 27th, 2023
Apply filter in data.table as in dplyr

Translate dplyr::filter into data.table code. Let's supposse I have: library(data.table) library(dplyr) dt data.table( A = c(TRUE, TRUE, TRUE), ...

rdplyrfilterdata.table
Read more
September 26th, 2023
The same function with different arguments called many times consecutively using dplyr pipes?

What I would like to achieve in general would be that I could do the following: df %>% exampleFunction(1) %>% exampleFunction(2) %>% examp...

rdplyr
Read more
September 25th, 2023
Conditional cumulative sum in R dplyr

I am trying to add a column to my df that will conditionally sum a column by group. When the value in the margin column is negative, it works fine. Ho...

rdplyr
Read more
September 19th, 2023
Dplyr can't filter min grouped value with na.rm = TRUE

I am unable to get dplyr (v. 1.1.2) to keep only minimum row values for a group of two variables when there is a NULL value in the group. Using na.rm ...

rdplyr
Read more
September 19th, 2023
Summarising and grouping of sports data. Dplyr acrobatics required

I have some data from a sporting club, and wish to summarise player data over each season. The issue that I have is that the source database generates...

rdplyr
Read more
September 12th, 2023
R dplyr fill fails to populate data in a dataframe

I am filling in the columns by group but it doesn't work as expected. My goal is to fill dates and then compare dates in each row and find the oldest ...

rdplyrtidyr
Read more
September 12th, 2023
How to separate and reattach columns with dplyr

I was wondering on how to separate into two diffrent chunks of the dataframe, a big dataframa and then make the column binding in dplyr I have use the...

rstringcbind
Read more
September 29th, 2023
How to duplicate and replace certain values in duplicated records multiple times using R and dplyr?

I have records in a dataframe that I want to duplicate multiple times, and apply some changes to each iteration of duplicate rows. Using the following...

dataframerdplyrfilterduplicates
Read more
September 6th, 2023
error when using `get` within a dplyr mutate statement in R

I have my R environment with some objects in it. tmp 1,2,4) dafa "Yes", value=4) Lists and Dataframes both come up as list when using: ty...

rdplyrtypeof
Read more
September 6th, 2023
How to pivot four columns into two by adding a grouping label using dplyr?

Dataset My simulated data looks like this: combo -0.184530460239927, 2.58876410608302, -0.376411897125282, -0.918020987034264, 0.267794817079365, 0.5...

rdplyrdata-wranglinglong-format-data
Read more
September 1st, 2023
apply dplyr function to time series failed

There is time series ttrc_total , when applying the dplyr function group_by mutate ..., there are failures. Is there way to solve it? Thanks! library...

rdplyrtime-seriesttr
Read more
August 31st, 2023
`tidyr::unnest`: "cant't recycle input" error **ONLY** when using `cols = dplyr::everything()`

Consider the following: library(magrittr) sapply(c("dplyr", "tibble", "tidyr"), requireNamespace) mytbl structure( list( A = list(c("A.1", "A.2...

rtidyversetidyrtibble
Read more
August 31st, 2023
R dplyr Rowwise sum

I have DATA = data.frame(GROUP = c(1,2,1,2,1,2), TIME = c(1,1,2,2,3,3), SCORE = c(0,7,9,8,3,4)) and seek to create WANT = data.frame(GROUP = c(1,2,3,1...

rdplyr
Read more

Hot Topic

  • 25881

    How do I undo the most recent local commits in Git?

  • 11618

    How can I remove a specific item from an array in JavaScript?

  • 20343

    How do I delete a Git branch locally and remotely?

  • 7387

    How can I find all files containing a specific text (string) on Linux?

  • 7330

    How to find all files containing specific text (string) on Linux?

  • 7611

    How do I revert a Git repository to a previous commit?

  • 2671

    How do I create an HTML button that acts like a link?

  • 8481

    How do I check out a remote Git branch?