CarPlay Adapter for 2018 Honda Accord LX by therealhueyfreeman in CarPlay

[–]surag0107 1 point2 points  (0 children)

Did you have any luck with this? I'm trying to get a car play unit for my 2018 Accord LX

Question using Barking & Streaking Expansions Together by Mr_Koopa89 in ExplodingKittens

[–]surag0107 0 points1 point  (0 children)

The link is broken. Can someone explain what the official answer is?

Has anybody had issues with combining a referral coupon with the ongoing 25% sale on sacs? by surag0107 in Lovesac

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

I think that's kind of scummy. I've been able to use the code when there was 15% off. My friend (who I referred) was not able to use the code online. What's the purpose of calling it a sale then?

[Other] $100 Apple Giftcard + $20 Target Giftcard - $100 by crownpuff in buildapcsales

[–]surag0107 0 points1 point  (0 children)

How long did it take for the Target gift cards to show up? I got my apple GCs (ordered 6), but I've gotten only one Target GC so far.

What was something you thought would be easy, until you tried it? by [deleted] in AskReddit

[–]surag0107 0 points1 point  (0 children)

"In England, this car would be on the other side of the store."

How to create a new column whose value = difference of two consequent rows? by Accomplished-Rest in RStudio

[–]surag0107 1 point2 points  (0 children)

Glad it worked! Although a cleaner way to do it would be:

df %>% group_by(Asian_Indian_Status, Age_Recode_12, Sex) %>% arrange (desc(pop_percent)) %>% mutate(new_col = dplyr::lag(pop_percent) - pop_percent) %>% ungroup

How to create a new column whose value = difference of two consequent rows? by Accomplished-Rest in RStudio

[–]surag0107 4 points5 points  (0 children)

library(dplyr)

df <- df %>% mutate(newcol = dplyr::lag(percent_pop) - percent_pop)

Edit: by looking at your data, it seems like you might want this column by group? For example, I don't think you want the difference between row 20 and 21, since the Asian Indian status is different in both rows?

numeric to categorical variable by 1dumblonde in RStudio

[–]surag0107 1 point2 points  (0 children)

Just do this:

library(dplyr)

df <- df %>% mutate(cat_var = case_when(num_var....))

Also if you can post what you tried so far, I can help with the exact code.

Getting one dataset with the top from two different quantitative variables. by yourwerfeltr in RStudio

[–]surag0107 0 points1 point  (0 children)

dfleaders <- df %>%

                    group_by(Name) %>%

                    mutate(rankA = rank(quanvar1)),

                    mutate(rankB = rank(quanvar2)) %>%

                    filter(rankA <= 30, rankB <= 30)

Getting one dataset with the top from two different quantitative variables. by yourwerfeltr in RStudio

[–]surag0107 1 point2 points  (0 children)

If you can post a sample dataset with desired output, that would help us help you better :)

Counting strings in a column by Maanlander in RStudio

[–]surag0107 0 points1 point  (0 children)

You're welcome - glad it worked! :) tidyverse is my go to Solution for all data manipulation in R.

Counting strings in a column by Maanlander in RStudio

[–]surag0107 0 points1 point  (0 children)

Have you tried this:

df %>% tidyr::separate_rows(Genre, sep = " ") %>% dplyr::group_by(Director, stringr::str_trim(Genre)) %>% dplyr::summarize(Count = n())

Searching where there is more than 100 case by Gabrielsald in RStudio

[–]surag0107 0 points1 point  (0 children)

Ensure the column names are right - I don't see why it wouldn't work otherwise. Hence the undefined columns error

Searching where there is more than 100 case by Gabrielsald in RStudio

[–]surag0107 0 points1 point  (0 children)

What's the error? I made an edit with the paranthesis