[R] ODP: Modificatio of function body within a function

2022-04-03 Thread Grzegorz Smoliński
Thank you, Bert! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

[R] Modificatio of function body within a function

2022-04-01 Thread Grzegorz Smoliński
Hi, I'm working on a presentation regarding the modification of the function body on-the-fly and just discovered something I don't understand. I would like to modify a body of the function within a function, but I see that it is possible only when explicitly referring to the environment where the

Re: [R] How to modify object's code living in some environment?

2021-12-29 Thread Grzegorz Smoliński
Murdoch napisał(a): > > On 28/12/2021 4:21 p.m., Grzegorz Smoliński wrote: > > Thank you for all the comments. If this is not a problem, I would like > > to continue this thread as for me a lot of questions are still open. > > But if I should post other questions in dif

Re: [R] How to modify object's code living in some environment?

2021-12-28 Thread Grzegorz Smoliński
ry much for all your help and I hope it is OK to keep asking :). pon., 27 gru 2021 o 18:28 Duncan Murdoch napisał(a): > > On 27/12/2021 8:25 a.m., Duncan Murdoch wrote: > > On 27/12/2021 8:06 a.m., Grzegorz Smoliński wrote: > >> Hi, > >> > >> I know it is poss

Re: [R] How to modify object's code living in some environment?

2021-12-27 Thread Grzegorz Smoliński
assumptions didn't knowing some topic :) pon., 27 gru 2021 o 14:27 Duncan Murdoch napisał(a): > > On 27/12/2021 8:25 a.m., Duncan Murdoch wrote: > > On 27/12/2021 8:06 a.m., Grzegorz Smoliński wrote: > >> Hi, > >> > >> I know it is possible to find the envi

[R] How to modify object's code living in some environment?

2021-12-27 Thread Grzegorz Smoliński
, those functions do not live in .GlobalEnv), but as you can see above, I can't use it to modify the code. Best regards, Grzegorz Smoliński __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] Wild cards for dataframes

2021-10-22 Thread Grzegorz Smoliński
Well, Wikipedia is probably the place where people who know some topic can check if people who wrote the article did it right :) You can try this short subchapter in R for Data Science (by Hadley Wickham) as a starting point:

Re: [R] creating a new variable and merging it on the dataframe

2021-10-18 Thread Grzegorz Smoliński
Hi, If you had really just used: wbpractice %>% mutate(gap = total.food.exp-total.nfood.exp) #gen a variable and then checked by: names(wbpractice) then the problem is just with missed assignment, i.e. it should be: wbpractice <- wbpractice %>% mutate(gap = total.food.exp-total.nfood.exp)

Re: [R] [EXTERNAL] Re: unexpected behavior in apply

2021-10-08 Thread Grzegorz Smoliński
This will work as well: d<-data.frame(d1 = letters[1:3], d2 = c(1,2,3), d3 = c(NA_character_,NA_character_,6)) apply(d, 2, FUN=function(x)all(x[!is.na(x)] <= 3)) d1 d2 d3 FALSE TRUE FALSE i.e. when NA changed do NA_character_ pt., 8 paź 2021 o 20:44

[R] ODP: unexpected behavior in apply

2021-10-08 Thread Grzegorz Smoliński
Hi, but why is there a space before 6? Isn't it the source of the problem? Best regards, Grzegorz pt., 8 paź 2021 o 20:14 Andrew Simmons napisał(a): > > Hello, > > > The issue comes that 'apply' tries to coerce its argument to a matrix. This > means that all your columns will become character

Re: [R] ODP: ggplot question

2021-09-16 Thread Grzegorz Smoliński
. Best regards, Grzegorz śr., 15 wrz 2021 o 21:03 Kai Yang napisał(a): > > Hi Grzegorz, > > You are correct. it works now. > > One more question: can I turn gc_label 90 degree in plot? > > Thank you > > Kai > > On Wednesday, September 15, 2021, 10:54:52 A

[R] ODP: ggplot question

2021-09-15 Thread Grzegorz Smoliński
Hi, Isn’t a bracket missing after gc_label? So it should be: > ggplot(s8_plot, aes(fill=GTresult, y=cases, x=gc_label)) + + geom_bar(position="stack", stat="identity")) Best, Grzegorz Od: Kai Yang via R-help Wysłano: środa, 15 września 2021 19:50 Do: R-help Mailing List Temat: [R] ggplot

[R] [R-pkgs] dedupewider - package to dedupe records across multiple columns

2021-07-16 Thread Grzegorz Smoliński
records will be collapsed into one record with 4 unique telephone numbers (optionally all unique names or information from other columns can be kept). Perhaps it will be helpful for you as well. Link to CRAN: https://CRAN.R-project.org/package=dedupewider Best regards, Grzegorz Smoliński