All Questions

-1
votes
1answers
933 views

Importing multiple .csv files with variable column types into R

How can I properly build an lapply to read (from out of one directory) all the .csv files, load all the columns as strings and then bind them into one data frame. Per this, I have a way to get all th...
3
votes
1answers
209 views

Print tibble with column breaks as in v1.3.0

Using the latest version of tibble the output of wide tibbles is not properly displayed when setting width = Inf. Based on my tests with previous versions wide tibbles were printed nicely until vers...
6
votes
1answers
2283 views

Spread with duplicate identifiers (using tidyverse and %>%)

My data looks like this: I am trying to make it look like this: I would like to do this in tidyverse using %>%-chaining. df <- structure(list(id = c(2L, 2L, 4L, 5L, 5L, 5L, 5L), start_end =...
2
votes
1answers
154 views

Grouping on multiple programmatically specified vars in dplyr 0.6

This is with the new dplyr, to be released Real Soon Now. The dplyr programming vignette gives an example of calling group_by with the grouping variables specified in an outer function: my_summarise...
6
votes
3answers
678 views

R: create dummy variables based on a categorical variable *of lists*

I have a data frame with a categorical variable holding lists of strings, with variable length (it is important because otherwise this question would be a duplicate of this or this), e.g.: df <- d...
-1
votes
1answers
57 views

Split Strings into values in long dataframe format

I have a dataframe that looks like the following example df which consist of a character variable VAR. df<-data.frame(ID = 1:2, VAR = c("VAL1\r\nVAL2\r\nVAL8","VAL2\r\nVAL5"), ...
14
votes
3answers
325 views

using tidyverse; counting after and before change in value, within groups, generating new variables for each unique shift

I am looking for a tidyverse-solution that can count occurrences of unique values of TF within groups, id in the data datatbl. When TF changes I want to count both forward and backwards from that poin...
8
votes
3answers
95 views

How to feed a list of unquoted column names into `lapply` (so that I can use it with a `dplyr` function)

I am trying to write a function in tidyverse/dplyr that I want to eventually use with lapply (or map). (I had been working on it to answer this question, but came upon an interesting result/dead-end. ...
7
votes
1answers
124 views

Map for nested `data_frame`s

When using map on a nested data_frame, I do not understand why the latter two version give an error: library(tidyverse) # dummy data df <- tibble(id = rep(1:10, each = 10), val =...
9
votes
1answers
291 views

tidyverse interfering with ggplot2? cannot access map_data

Running these commands in the console, the output is: > cty0 = ggplot2::map_data("county") > library(tidyverse) Loading tidyverse: ggplot2 Loading tidyverse: tibble Loading tidyverse: tidyr Loa...

Previous Next