similar to: Risks of using "function <- package::function" ?

Displaying 20 results from an estimated 10000 matches similar to: "Risks of using "function <- package::function" ?"

2017 Nov 17
0
Risks of using "function <- package::function" ?
On 16/11/2017 4:53 PM, Boris Steipe wrote: > Large packages sometimes mask each other's functions and that creates a headache, especially for teaching code, since function signatures may depend on which order packages were loaded in. One of my students proposed using the idiom > > <function> <- <package>::<function> > > ... in a preamble, when we use
2017 Nov 17
2
Risks of using "function <- package::function" ?
Obvious? How about "obscurity"? Just directly use pkg::fun if you have name collision. -- Sent from my phone. Please excuse my brevity. On November 16, 2017 4:46:15 PM PST, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: >On 16/11/2017 4:53 PM, Boris Steipe wrote: >> Large packages sometimes mask each other's functions and that creates >a headache,
2020 Jun 27
1
roxygen2 / documentation of reexports
Dear colleagues, preparing a release of my package ?polmineR? I encountered the following issue with a new warning issued when running R CMD check with the --as-cran option on Debian with R-devel. To reexport the magrittr pipe operator %>%, my package adopted I snippet you?d see in the dplyr package, for instance: #' @importFrom magrittr %>% #' @export magrittr::`%>%` The
2018 Dec 17
1
Function I mean not to export keeps being documented in a manual?
I am developing an R package which has a function I decided not to export. I believe the roxygen information states that the function is not going to be exported, yet I still see the function in the manual PDF (as generated in command line via `CMD Rd2pdf package_dir`). What is wrong with my preamble that the function is still being documented in a manual? #' Generates plots for demo of
2017 Sep 25
1
Subset
Always via logical expressions. In this case you can use the logical expression myDF$b != "0" to give you a vector of TRUE/FALSE B. > On Sep 25, 2017, at 8:00 AM, Shane Carey <careyshan at gmail.com> wrote: > > This is super, really helpfull. Sorry, one final question, lets say I wanted to remove 0's rather than NAs , what would it be? > > Thanks >
2017 Sep 25
2
Subset
myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"), b = c("<0.1", 1, 0.3, 5, "Nil"), stringsAsFactors = FALSE) # you can subset the b-column in several ways myDF[ , 2] myDF[ , "b"] myDF$b # using the column, you make a logical vector ! is.na(as.numeric(myDF$b)) # This can be used to select the
2017 Jun 28
4
Nash equilibrium and other game theory tools implemented in networks using igraph or similar
I responded to the unhelpful suggestion "Why don't you implement and uplad the package to CRAN?" No mention of a search engine. Is this what you are commenting on Jeff? > On Jun 28, 2017, at 5:41 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > > In what way does reminding people that packages exist because others just like them contributed something
2018 Mar 21
2
Sum of columns of a data frame equal to NA when all the elements are NA
No. The empty sum is zero. Adding it to another sum should not change it. Nothing audacious about that. This is consistent; other definitions just cause trouble. -pd > On 21 Mar 2018, at 18:05 , Boris Steipe <boris.steipe at utoronto.ca> wrote: > > Surely the result of summation of non-existent values is not defined, is it not? And since the NA values have been _removed_,
2017 Sep 25
0
Subset
This is super, really helpfull. Sorry, one final question, lets say I wanted to remove 0's rather than NAs , what would it be? Thanks On Mon, Sep 25, 2017 at 12:41 PM, Boris Steipe <boris.steipe at utoronto.ca> wrote: > myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"), > b = c("<0.1", 1, 0.3, 5, "Nil"), >
2017 Sep 22
3
Subset
Super, Thanks On Fri, Sep 22, 2017 at 4:57 PM, Boris Steipe <boris.steipe at utoronto.ca> wrote: > > a <- c("<0.1", NA, 0.3, 5, "Nil") > > a > [1] "<0.1" NA "0.3" "5" "Nil" > > > b <- as.numeric(a) > Warning message: > NAs introduced by coercion > > b > [1] NA NA 0.3
2023 Jul 22
2
plotly
ChatGPT-4: ------ Query: ---------------------------------- Thank you. The `value` in the code example is 2874. The plot shows a large number at the center and a smaller value computed as a delta relative to the `reference` of 4800. But the large value is given as 2870, and the smaller value is given as -1930 i.e. both values are rounded. Can I control the precision of these two numbers?
2017 Nov 18
3
Complicated analysis for huge databases
The loop : AllMAFs <- list() for (i in length(SeparatedGroupsofmealsCombs) { AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2, function(x)maf( tabulate( x+1) )) } gives these errors (I tried this many times and I'm sure I copied it entirely) :- Error in apply(SeparatedGroupsofmealsCombs[[i]], 2, function(x) maf(tabulate(x + : object 'i' not found > }
2003 Sep 28
1
infinite recursion during package installation with methods, setAs
I ran into a problem recently trying to update a package which uses S4 methods using a recent beta of R. I think I can reproduce it with a simple example. I have package called `testpkg' in directory testpkg/. In the R/ subdirectory of testpkg/ I have a file called testpkg.R which contains the following two lines: setClass("testpkg", representation(pts = "list"))
2017 Nov 18
0
Complicated analysis for huge databases
> On Nov 18, 2017, at 1:52 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote: > > Although the loop seems to be formulated correctly I wonder why > it gives me these errors : > > -object 'i' not found > - unexpected '}' in "}" You probably did not copy the entire code offered. But we cannot know since you did not "show your code",
2017 Aug 03
0
find similar words in text
Please keep messages on the list so others can pitch in. _Which_ words do you want to consider identical for the purpose of frequency count? _What_ do you want to plot? B. > On Aug 3, 2017, at 4:36 PM, Riaan Van Der Walt <Riaan.VanDerWalt at nwu.ac.za> wrote: > > Hallo Boris, > I've loaded the Rstem, Snowball. > But I am clueless how to get a list eg. whal* (whale,
2017 Nov 18
2
Complicated analysis for huge databases
Although the loop seems to be formulated correctly I wonder why it gives me these errors : -object 'i' not found - unexpected '}' in "}" the desired output is expected to be very large as for each dataframe in the list of dataframes I expect to see maf value for each of the 600 columns! and this is only for for one dataframe in the list .. I have around 150-200
2018 Mar 21
1
Sum of columns of a data frame equal to NA when all the elements are NA
"I see: consistency with additive identity. " Ummm, well: > 1+NULL numeric(0) > sum(1,NULL) [1] 1 Of course, there could well be something here I don't get, but that doesn't look very consistent to me. However, as I said privately, so long as the corner case behavior is documented, which it is, I don't care. Cheers, Bert Bert Gunter "The trouble with
2018 Mar 21
0
Sum of columns of a data frame equal to NA when all the elements are NA
I see: consistency with additive identity. That makes sense. Thanks. B. > On Mar 21, 2018, at 1:22 PM, peter dalgaard <pdalgd at gmail.com> wrote: > > No. The empty sum is zero. Adding it to another sum should not change it. Nothing audacious about that. This is consistent; other definitions just cause trouble. > > -pd > >> On 21 Mar 2018, at 18:05 , Boris
2017 Jun 28
0
Nash equilibrium and other game theory tools implemented in networks using igraph or similar
Thanks I too wondered about the tone. The first suggestion was that I should "google it" and the second, write my own code. I think if I did I'd be reinventing the wheel, (and it'd be a big challenge for me). Also, I have been searching and not found such code, despite evidence that it has been coded (just not sure if it was in R). BTW I did write to authors of the article I
2016 Apr 03
2
row.names(), rownames(), colnames(), names() ...?
The help text for row+colnames {base} states: "For a data frame, rownames and colnames eventually call row.names and names respectively, but the latter are preferred." Why are they "preferred"? Why is it names(), not col.names()? I have only ever used names() for vectors - I'm surprised it works on data.frames... IMO this is not great for code readability, thus