search for: dplyr

Displaying 20 results from an estimated 175 matches for "dplyr".

2016 Apr 19
2
installation of dplyr
You normally see these errors when compiling on a vm that has very little memory. Hadley On Tue, Apr 19, 2016 at 2:47 PM, Ben Tupper <btupper at bigelow.org> wrote: > Hello, > > I am getting a fresh CentOS 6.7 machine set up with all of the goodies for R 3.2.3, including dplyr package. I am unable to successfully install it. Below I show the failed installation using utils::install.packages() and then again using devtools::install_github(). Each yields an error similar to the other but not quite exactly the same - the error messages sail right over my head. > > I...
2016 Apr 19
1
installation of dplyr
Hello, I am getting a fresh CentOS 6.7 machine set up with all of the goodies for R 3.2.3, including dplyr package. I am unable to successfully install it. Below I show the failed installation using utils::install.packages() and then again using devtools::install_github(). Each yields an error similar to the other but not quite exactly the same - the error messages sail right over my head. I can cont...
2017 Jul 25
2
To Supporting graphpad prism in R, add external library to poratbleR
1) Definitely yes. They are on CRAN. Just type install.packages( c("dplyr", "tidyr" ) ) at the R console. 2) Don't know, but most likely the answer is yes. Since all R packages on Linux are compiled by R when installed, you either need to activate your virtual machine, compile the packages, and save the state for future use, or you have to build the...
2017 Sep 08
2
quote()/eval() question
Dear list, For a reason it would take me long to explain, I need to do something along the lines of what's shown below -- i.e., create an object from dplyr::summarise, and then evaluate it on a data frame. I know I could directly do: df %>% dplyr::summarise(x1_mean = mean(x1)) but this is not what I'm looking for. library(dplyr) df <- data.frame(x1 = rnorm(100), x2 = rnorm(100)) foo <- function(df) { mySummary <- quote(dplyr...
2018 Mar 14
0
R crashing with a segmentation fault: how to locate the cause
...ny help would be appreciated. Thanks, Eric ==12589== Invalid read of size 1 ==12589== at 0x4C2F1B1: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==12589== by 0x4F71AC1: Rf_inherits (in /usr/lib/R/lib/libR.so) ==12589== by 0x11AFED3A: dplyr::subset_visitor_vector(SEXPREC*) (subset_visitor_impl.h:51) ==12589== by 0x11AFF58C: dplyr::subset_visitor(SEXPREC*, dplyr::SymbolString const&) (subset_visitor_impl.h:21) ==12589== by 0x11AFEC18: dplyr::DataFrameSubsetVisitors::DataFrameSubsetVisitors(Rcpp::DataFrame_Impl<Rcpp::Preser...
2018 May 30
2
Filtering using multiple rows in dplyr
Hi Folks, I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice. Here is my basic data frame. head(h) subject ageGrp ear hearingGrp sex freq L2 Ldp Phidp NF SNR 1 HALAF032 A...
2017 Nov 29
1
dplyr - add/expand rows
...hes. When I read the avalanche of solutions neither of which mentioning data.table (my first choice for data.frame-manipulations), I became curious how a one-liner data.table code performs against the other solutions in terms of speed and readability. Second, I quite often have the feeling that dplyr is extremely overused among novice (and sometimes even experienced) R users nowadays. This is unfortunate, as the present example also illustrates. Regards, Denes > > For the R-help list, maybe something about least specialized R knowledge > required would be appropriate? I'd say...
2014 Nov 21
0
dplyr/summarize does not create a true data frame
I got an error when trying to extract a 1-column subset of a data frame (called "my.output") created by dplyr/summarize. The ncol() function says that my.output has 4 columns, but "my.output[4]" fails. Note that converting my.output using as.data.frame() makes for a happy ending. Is this the intended behavior of dplyr? Tx, John > library(dplyr) > # set up data frame > rows = 100...
2017 Sep 09
1
Avoid duplication in dplyr::summarise
Dear group, Is there a way I could avoid the sort of duplication illustrated below? i.e., I have the same dplyr::summarise function on different group_by arguments. So I'd like to create a single summarise function that could be applied to both. My attempt below fails. df <- data.frame(matrix(rnorm(40), 10, 4), f1 = gl(3, 10, labels = letters[1:3]), f2 = gl(3, 10, la...
2017 Aug 07
1
tidyquant error downloading symbols for Index
...from a quantmod author: https://www.datacamp.com/courses/importing-and-managing-financial-data-in-r Loading required package: tidyverse Loading tidyverse: ggplot2 Loading tidyverse: tibble Loading tidyverse: tidyr Loading tidyverse: readr Loading tidyverse: purrr Loading tidyverse: dplyr Conflicts with tidy packages ----------------------------------------------------- as.difftime(): lubridate, base date(): lubridate, base filter(): dplyr, stats first(): dplyr, xts intersect(): lubridate, base lag(): dplyr, stats last(): dplyr, xts setdiff():...
2017 Nov 29
1
dplyr - add/expand rows
...help list, maybe something about least specialized R knowledge required would be appropriate? I'd say there were some 'hard' solutions -- Michael (deep understanding of Bioconductor and IRanges), Toth (deep understanding of data.table), Jim (at least for me moderate understanding of dplyr,especially the .$ notation; a simpler dplyr answer might have moved this response out of the 'difficult' category, especially given the familiarity of the OP with dplyr). I'd vote for Bill's as requiring the least specialized knowledge of R (though the +/- 1 indexing is an e...
2018 May 03
2
Converting a list to a data frame
...mes( L ) > , stringsAsFactors = FALSE > ) > D$data <- L > unnest(D, data) > #> Type x y > #> 1 A 1 3 > #> 2 A 2 4 > #> 3 B 5 7 > #> 4 B 6 8 > ######## I think a slightly more idiomatic tidyverse solution is dplyr::bind_rows() l <- list( A = data.frame(x = 1:2, y = 3:4), B = data.frame(x = 5:6, y = 7:8) ) dplyr::bind_rows(l, .id = "type") #> type x y #> 1 A 1 3 #> 2 A 2 4 #> 3 B 5 7 #> 4 B 6 8 This also has the advantage of returning a data frame when the inpu...
2017 Jul 11
1
dplyr help
...gt; >Peter > >-----Original Message----- >From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.ca.us] >Sent: 10 July 2017 03:52 PM >To: r-help at r-project.org; Mangalani Peter Makananisa; >r-help at r-project.org >Cc: Vito Ricci (vito_ricci at yahoo.com) >Subject: Re: [R] dplyr help > >I am pretty sure that this is not a question about dplyr... it is a >question about tidyr. Look at the help file ?tidyr::spread. > >If I understand your question (I may not, because you gave no example >of input/output data), the answer is no, the column names come fr...
2017 Sep 09
1
Avoid duplication in dplyr::summarise
...enlig hilsen/ Best regards Edjabou Maklawe Essonanawe Vincent Mobile: +45 31 95 99 33 On Sat, Sep 9, 2017 at 12:30 PM, Lars Bishop <lars52r at gmail.com> wrote: > Dear group, > > Is there a way I could avoid the sort of duplication illustrated below? > i.e., I have the same dplyr::summarise function on different group_by > arguments. So I'd like to create a single summarise function that could be > applied to both. My attempt below fails. > > df <- data.frame(matrix(rnorm(40), 10, 4), > f1 = gl(3, 10, labels = letters[1:3]), >...
2017 Nov 26
1
dplyr - add/expand rows
dplyr may have something for this, but in base R I think the following does what you want. I've shortened the name of your data set to 'd'. i <- rep(seq_len(nrow(d)), d$YEAR_TO-d$YEAR_FROM+1) j <- sequence(d$YEAR_TO-d$YEAR_FROM+1) transform(d[i,], YEAR=YEAR_FROM+j-1, YEAR_FROM=NULL, Y...
2017 Sep 09
1
Avoid duplication in dplyr::summarise
Hi Lars, Two comments: 1. You can achieve what you want with a slight modification of your definition of s(), using the hint from the error message that you need an argument '.': s <- function(.) { dplyr::summarise(., x1m = mean(X1), x2m = mean(X2), x3m = mean(X3), x4m = mean(X4)) } 2. You have not given a great test case in how you set your two factors because the two group_by()'s will give the identical groupings, An alternative which...
2018 Mar 22
1
Calculate weighted proportions for several factors at once
Hi, I have a grouped data set and would like to calculate weighted proportions for a large number of factor variables within each group member. Rather than using dplyr::count() on each of these factors individually, the idea would be to do it for all factors at once. Does anyone know how this would work? Here is a reproducible example: ############################################################ # reproducible example df1 <- data.frame(wt=rnorm(90),...
2018 Feb 02
1
Updating Rcpp package when it is claimed by dplyr
...i tried to install the hunspell package, I got this error message: Error: package ?Rcpp? 0.12.3 was found, but >= 0.12.12 is required by ?hunspell? So I set about installing a new version of Rcpp but I get this message: Error in unloadNamespace(pkg_name) : namespace ?Rcpp? is imported by ?dplyr? so cannot be unloaded How does one get around that? I tried installing Rcpp in a vanilla session but the result was the same. TIA Patrick > sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.5 LTS Matrix products: default BLAS: ...
2017 Jul 25
0
To Supporting graphpad prism in R, add external library to poratbleR
...rtableR web page link that you quoted. Do you have the directories referred to there in place? -- Sent from my phone. Please excuse my brevity. On July 25, 2017 7:27:31 AM PDT, Ashish Ranjan <aranjan1645 at gmail.com> wrote: >Hi Jeff, > >1). I have tried install.packages( c("dplyr", "tidyr" ) ) into the >r-script >file got below error:- > >> install.packages( c("dplyr", "tidyr" ) ) >Installing packages into >?/tmp/1776492876238396447/lib/portableR-master/site-library? >(as ?lib? is unspecified) &g...
2018 Feb 02
1
Updating Rcpp package when it is claimed by dplyr
Your last statement is extremely unlikely to be true. The dplyr package should not be present in a vanilla environment, so there should be no such conflict. -- Sent from my phone. Please excuse my brevity. On February 1, 2018 11:00:01 PM PST, Patrick Connolly <p_connolly at slingshot.co.nz> wrote: >When i tried to install the hunspell package, I go...