Re: [R] Two geom_bar with counts to put in the same plot

2019-12-05 Thread Jim Lemon
Hi Francesca, Do you want something like this? Jim On Thu, Dec 5, 2019 at 6:58 PM Francesca wrote: > > Hi, sorry for bothering again. > I was wondering how I can reshape the data, if in your code, > I would like to have only two panels, where in the panel with Participation > =0, I represent de

Re: [R] Two geom_bar with counts to put in the same plot

2019-12-05 Thread Francesca
Exactly. I was trying to remelt data in the right way, but I could not get there yet. Can you suggest me this code? Thanks a lot F. -- > Il giorno 5 dic 2019, alle ore 11:11, Jim Lemon ha > scritto: > > Hi Francesca, > Do you want something like this? > > Jim

Re: [R] How to use preProcess in Caret?

2019-12-05 Thread Burak Kaymakci
Hello there, Yes, I'd tried scale as well. I mean, I could do my preprocessing separately and it was working fine. I was just wondering how preProcess argument in train function works. As far as I know, when preProcess argument is set, it normalizes inputs but not outputs. Then I've figured we co

Re: [R] Two geom_bar with counts to put in the same plot

2019-12-05 Thread Francesca
This is a consolation, because I cannot get it in ggplot either! Thanks for the code! F. > Il giorno 5 dic 2019, alle ore 11:17, Jim Lemon ha > scritto: > > Sorry it's not ggplot, I couldn't work that one out. > > # using the data frame structure that Rui kindl

[R] how to deal with deprecated functions

2019-12-05 Thread Nestor Toledo
Hello everyone, even I'm not fluent in coding, R has become a fundamental part of my daily work as a researcher and I'm very much grateful for such a wonderful, open tool. However, I have faced in many opportunities the problems associated with updates/upgrades of packages. Frequently packages

[R] Help to write the R-code, please

2019-12-05 Thread Александр Дубровский
Task: A family of sets of letters is given. Find K for which one can construct a set consisting of K letters, each of them belonging to exactly K sets of a given family. Possible solution: For each letter, we will have a separate 'scoop', in which we will' put ' the letter. This can be done using

[R] Method dispatch sometimes failsfor lavaan objects

2019-12-05 Thread Ulrich KELLER
Hello, in some R sessions, method dispatch for objects of the (S4) class “lavaan" fail. An example from such a “bad” session: > library(lavaan) > HS.model <- ' visual =~ x1 + x2 + x3 + textual =~ x4 + x5 + x6 + speed =~ x7 + x8 + x9 ' > fit <- cfa(HS.model, data =

Re: [R] how to deal with deprecated functions

2019-12-05 Thread Rui Barradas
Hello, If you are talking about CRAN packages, like it seems you are, then there is no general purpose solution. What is deprecated depends on each package's team of developers/maintainer. Since R is open source and so must be all CRAN packages, a possible solution is to have your own packag

Re: [R] Help to write the R-code, please

2019-12-05 Thread Jeff Newmiller
On December 5, 2019 3:39:07 AM PST, "Александр Дубровский" wrote: >Task: >A family of sets of letters is given. Find K for which one can >construct a >set consisting of K letters, each of them belonging to exactly K sets >of a >given family. ... > > [[alternative HTML version deleted]]

Re: [R] how to deal with deprecated functions

2019-12-05 Thread J C Nash
I would second Rui's suggestion. However, as a package developer and maintainer, I think it is important to note that users need to be encouraged to use good tools. I work with optimization codes. My software was incorporated into the optim() function a LONG time ago. I have updated and expanded

Re: [R] Two geom_bar with counts to put in the same plot

2019-12-05 Thread Rui Barradas
Hello, A ggplot graph follows almost exactly my previous code. The *only* difference is in facet_wrap(). See below. library(ggplot2) idv <- grep("part", names(DB)[-(3:4)], ignore.case = TRUE, value = TRUE) dblong <- reshape2::melt(DB[-(3:4)], id.vars = idv) dblong <- reshape2::melt(dblong, i

[R] readxl question

2019-12-05 Thread Thomas Subia
Colleagues, I'm trying to extract a cell from all Excel files in a directory. library(readxl) files <- list.files(pattern="*.xls", full.names = FALSE) date <- lapply(files, read_excel, sheet="Sheet1", range=("B5")) date_df <- as.data.frame(date) trans_date <-t(date_df) mydates <- list(trans_dat

Re: [R] how to deal with deprecated functions

2019-12-05 Thread Duncan Murdoch
On 04/12/2019 2:07 p.m., Nestor Toledo wrote: Hello everyone, even I'm not fluent in coding, R has become a fundamental part of my daily work as a researcher and I'm very much grateful for such a wonderful, open tool. However, I have faced in many opportunities the problems associated with update

Re: [R] Help to write the R-code, please

2019-12-05 Thread Ivan Krylov
It might be easier to implement in R if you employ the base functions that take arrays and operate on them as if they represented sets. See the help() for "union", "intersect", "setdiff", "setequal" and the operator "%in%". -- Best regards, Ivan __ R-h

Re: [R] readxl question

2019-12-05 Thread Ivan Krylov
On Thu, 5 Dec 2019 15:39:56 + Thomas Subia wrote: > date <- lapply(files, read_excel, sheet="Sheet1", range=("B5")) > date_df <- as.data.frame(date) > trans_date <-t(date_df) > mydates <- list(trans_date) This feels a bit excessive for what looks like a one-dimensional string vector. Why is

[R] passing reference class method within the class as an argument

2019-12-05 Thread Eric Berger
Here is the code of a reproducible example: foo <- setRefClass("foo", fields=list(x="numeric"), methods=list( initialize=function(a) { x <<- a }, funcA=function(f)

Re: [R] [FORGED] readxl question

2019-12-05 Thread Rolf Turner
The best advice that anyone could give: See fortunes::fortune("Friends") . cheers, Rolf Turner On 6/12/19 4:39 am, Thomas Subia wrote: Colleagues, I'm trying to extract a cell from all Excel files in a directory. library(readxl) files <- list.files(pattern="*.xls", full.names = FALSE) da

Re: [R] Help to write the R-code, please

2019-12-05 Thread Richard O'Keefe
This particular task is not a problem about R. It is a problem n combinatorics. Start with the obvious brute force algorithm (1) Let S be the union of all the sets (2) For each K in 0 .. |S| (3) Enumerate all |S| choose K subsets C of S (4) If C satisfies the condition, report it and stop (5)

[R] SOLVED: passing reference class method within the class as an argument

2019-12-05 Thread Eric Berger
Here is the modified code of the reproducible example I sent previously. Notice the .self$ prefix to funcB which is what has changed foo <- setRefClass("foo", fields=list(x="numeric"), methods=list( initialize=function(a) {

[R] How prevent update of a package

2019-12-05 Thread Marc Girondot via R-help
I use R 3.6.1 in macOSX 10.15.1 (Catalina). I cannot install the last version (3.0-7) of the package raster from source or from binary. In both cases I get ??*** caught segfault *** address 0x31, cause 'memory not mapped' when I try to load it. Same occurs when I use the development version

Re: [R] How prevent update of a package

2019-12-05 Thread Amit Mittal
Just install Older R from the project R archives in a separate directory Best Regards Please excuse the brevity of the message. This message was sent from a mobile device. From: R-help on behalf of Marc Girondot via R-help Sent: Friday, December 6, 2019 1:09