Re: [R] Good practice for database with utf-8 string in package

2021-09-16 Thread Bert Gunter
This should not be posted here. Post on the R-package-devel list instead. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Sep 16,

Re: [R] adding results to plot

2021-09-16 Thread Bert Gunter
I was wrong. text() will attempt to coerce to character. This may be informative: > as.character(res) [1] "c(W = 0.992709285275917)""0.869917232073854" [3] "Shapiro-Wilk normality test" "rnorm(100)" plot(0:1, 0:1); text(0,seq(.1,.9,.2), labels = res

Re: [R] adding results to plot

2021-09-16 Thread Bert Gunter
res is a list of class "htest" . You can only add text strings to a plot via text(). I don't know what ggplot does. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "

Re: [R] error with dbFD function in FD library

2021-09-15 Thread Bert Gunter
ly?) correct, your data cannot support the analyses that you are trying to do. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On We

Re: [R] pseudoreplication

2021-09-14 Thread Bert Gunter
This should be posted on r-sig-mixed-models, not here. But you should realize that "equivalent analysis" presumes knowledge of what ASReml does, so that perhaps the best target of your query is the package maintainer, not a list concerned with other methods. Bert Gunter "The trou

Re: [R] Need fresh eyes to see what I'm missing

2021-09-14 Thread Bert Gunter
Inline. On Tue, Sep 14, 2021 at 10:42 AM Rich Shepard wrote: > > On Tue, 14 Sep 2021, Eric Berger wrote: > > > My suggestion was not 'to make a difference'. It was to determine whether > > the NAs or NaNs appear before the dplyr commands. You confirmed that they > > do. There are 2321 NAs in

Re: [R] Need fresh eyes to see what I'm missing

2021-09-14 Thread Bert Gunter
t all you did or what kind of junk in your .csv file may be causing R to misread the numeric data as character. As I said, others may be wiser and correct any errors in my "advice." This is as far as I can go -- and it may already be too far. Bert Gunter "The trouble with h

Re: [R] Need fresh eyes to see what I'm missing

2021-09-14 Thread Bert Gunter
Remove all your as.integer() and as.double() coercions. They are unnecessary (unless you are preparing input for C code; also, all R non-integers are double precision) and may be the source of your problems. Bert Gunter "The trouble with having an open mind is that people keep coming

Re: [R] tidyverse: grouped summaries (with summarize) [RESOLVED]

2021-09-13 Thread Bert Gunter
manual summarization and plotting. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Sep 13, 2021 at 5:15 PM Rich Shepard wrote: > >

Re: [R] Evaluating lazily 'f<-' ?

2021-09-13 Thread Bert Gunter
bbit hole unless you are comfortable with recursion and have good reason to compute on the language. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Re: [R] how to find "first" or "last" record after sort in R

2021-09-09 Thread Bert Gunter
Sorry, that should be > id <- c(1,2,2,2,3,4,5,5) > last.index <- cumsum(rle(id)$lengths) > last.index [1] 1 4 5 6 8 of course. Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkel

Re: [R] how to find "first" or "last" record after sort in R

2021-09-09 Thread Bert Gunter
id <- c(1,2,2,2,3,4,5,5) > last.index <- cumsum(rle(test)$lengths) > last.index [1] 1 4 5 6 8 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom Coun

Re: [R] Splitting a data column randomly into 3 groups

2021-09-05 Thread Bert Gunter
Note > that sum{m[i]} for i <=g must sum to n, where m[i] is the number of > items in the ith group. > Third, write R code for the algorithm. Exercise for the reader. > > I may be wrong, but I think numerical analysts might also have a > little fun here. > > Randomizati

Re: [R] Help with bibliometrix and biblioshiny

2021-09-05 Thread Bert Gunter
you might get lucky here, you should probably contact the maintainers. I also noted that the package has its own web page with a FAQ and other resources. Have you consulted them yet? There might also be a user community that could help, but I did not see it in my brief look around. Bert Gu

Re: [R] Splitting a data column randomly into 3 groups

2021-09-04 Thread Bert Gunter
I have a more general problem for you. Given n items and 2 <=g < wrote: > > Dear Thomas: > > > Thank you very much for your input in this matter. > > > The core part of this R code(s) (please see below) was written by *Richard > O'Keefe*. I had three examples with different sample sizes. > > > >

Re: [R] Calculate daily means from 5-minute interval data

2021-08-30 Thread Bert Gunter
e as straightforward as you think -- you may wish to find a local statistician with some experience in these sorts of things to help you deal with them. Up to you, of course. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking thin

Re: [R] Gene Set Enrichment Analysis and plots

2021-08-30 Thread Bert Gunter
not here: https://www.bioconductor.org/help/ (Do read their pg before posting, of course) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon

Re: [R] unable to install source packages with Rtools installed

2021-08-24 Thread Bert Gunter
1. Why not installed a pre-built binary for Windows? (No need to reply ... Just saying.) 2. You should post the results of sessionInfo() to better enable others to help you. Also post any error or diagnostic messages you received. Cheers, Bert Bert Gunter "The trouble with having an open

Re: [R] Specifying non-linear mixed effects models in R (non-linear DV)

2021-08-24 Thread Bert Gunter
of design, interpretation, and use that are best explored in direct dialogue. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) O

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread Bert Gunter
should not be contacting them either. See here for general guidelines for R lists: https://www.r-project.org/mail.html Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom Coun

Re: [R] Dynamic Creation and Use of Object Names

2021-08-23 Thread Bert Gunter
e depicted on the same scale with appropriate legends. (Of course, ignore if this is not the case). If so, you will need a different data structure for your data, I believe. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it

Re: [R] Help needed with ggplot2

2021-08-21 Thread Bert Gunter
See ?dput for how to provide a reproducible example (a reprex). Or see here: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example It will improve your chance of getting a helpful and quick response. Cheers, Bert Gunter "The trouble with having an open

Re: [R] Find "undirected" duplicates in a tibble

2021-08-20 Thread Bert Gunter
;- expand.grid(sample.int(1000), sample.int(1000)) ## > system.time(g(y)) user system elapsed 0.896 0.027 0.924 ## > system.time(f(y)) user system elapsed 0.142 0.009 0.151 And, yes, I was surprised by this, too. Again, it may not matter, but it is interesting. Your m

Re: [R] Find "undirected" duplicates in a tibble

2021-08-20 Thread Bert Gunter
, 2] > x[,1] x[w, ] <- x[w, 2:1] unique(x)}) user system elapsed 0.693 0.011 0.703 The efficiency gains are due to vectorization and the use of more efficient primitives. None of this may matter of course, but it seemed worth mentioning. Cheers, Bert Bert Gunter &

Re: [R] Package for "design graphs"

2021-08-17 Thread Bert Gunter
Have you looked at the gR Task View on CRAN: https://cran.r-project.org/web/views/gR.html (I have no idea whether it's relevant to your query, though). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkele

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Bert Gunter
Ah yes. Duhhh... Thanks Rui. So h$density *diff(h$breaks) *100 will give the percentages. No need for arithmetic beyond that. Bert On Tue, Aug 17, 2021 at 12:03 PM Rui Barradas wrote: > > Hello, > > > > Às 19:28 de 17/08/21, Bert Gunter escreveu: > > Inline below. >

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Bert Gunter
= hist_title, xlab = "Amount", > labels = scales::percent(h$counts/sum(h$counts)), > ylim = c(0, 1.1*max(h$counts))) > }) > par(old_par) > > > Hope this helps, > > Rui Barradas > > Às 01:49 de 17/08/21, Bert Gunter escreveu: > &g

Re: [R] Including percentage values inside columns of a histogram

2021-08-16 Thread Bert Gunter
myhist has class "histogram" Note that I expanded the y axis a bit to be sure to include the labels. You can, of course, plot your separate years as Rui has indicated or via e.g. ?layout. Apologies if I have misunderstood. Just ignore this in that case. Otherwise, I leave it to y

Re: [R] R.app spontaneously switching windows during editing

2021-08-14 Thread Bert Gunter
Sorry, I can't help; but you should post this on the r-sig-mac list instead of here I think. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Re: [R] ggplot: add percentage for each element in legend and remove tick mark

2021-08-13 Thread Bert Gunter
It's dput() *not* dupt() . ?dput tells you how to use it (as usual). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Aug 13, 2021 at

Re: [R] collided row names in heatmap.2

2021-08-11 Thread Bert Gunter
getting useful help here as you climb the learning curve. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 11, 202

Re: [R] Sanity check in loading large dataframe

2021-08-09 Thread Bert Gunter
FWIW: Yes, thanks for noting that. My own preference is to always propagate NA's and manually decide how to deal with them, but others may disagree. Best, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (ak

Re: [R] Markov modeling using msm

2021-08-07 Thread Bert Gunter
ame") to find this information. Only send such questions to R-help or R-devel if you get no reply or need further assistance. This applies to both requests for help and to bug reports." So perhaps contacting the msm maintainer might be another possibility. See ?maintainer for how to find t

Re: [R] Sanity check in loading large dataframe

2021-08-06 Thread Bert Gunter
... but remove the which() and use logical indexing ... ;-) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Aug 6, 2021 at 12:57

Re: [R] correlation by factor

2021-07-27 Thread Bert Gunter
out <- by(cbind(R,Day), factor(Freq), FUN = \(x)cor(x)[1,2]) ## to just get the off-diagonal of the 2x2 cor matrix > as.list(out) $a1 [1] 1 $a2 [1] -0.7559289 $a3 [1] 0 $a4 [1] 0.1889822 $a5 [1] -0.8660254 See ?by and ?cor for details as needed. Bert Gunter "The trouble with ha

Re: [R] Satelit Image

2021-07-26 Thread Bert Gunter
-project.org/web/views/ Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Jul 26, 2021 at 10:27 AM javad bayat wrote: > Dear all; >

Re: [R] Testing for R CMD INSTALL

2021-07-24 Thread Bert Gunter
Does ?installed.packages help? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jul 24, 2021 at 8:30 AM Andrew Simmons wrot

Re: [R] Converting a list to a data frame

2021-07-24 Thread Bert Gunter
If this is not correct, you should provide a **plain text** reprex. Of course, even if correct, this is not a template. The exact process will depend on the structure of the list. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it

Re: [R] Assigning categorical values to dates

2021-07-21 Thread Bert Gunter
You have been told how to do it. If you do not understand, you should find a suitable tutorial to learn about how R factors work. There are some difficulties in converting dates on an ongoing basis to factors, so I think you should take Tom's advice to rethink this. It sounds as if you might also

Re: [R] Using R to analyse Court documents

2021-07-20 Thread Bert Gunter
Look here: https://cran.r-project.org/web/views/NaturalLanguageProcessing.html Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Jul

Re: [R] ask for help about lme function

2021-07-20 Thread Bert Gunter
The mixed models list is r-sig-mixed-models . nlme:lme is not really designed for crossed random effects. IIRC, it's possible, but not easy. As Kevin said, lme4:lmer is really what you should use. Bert Gunter "The trouble with having an open mind is that people keep coming along and sti

Re: [R] ls() pattern question

2021-07-15 Thread Bert Gunter
be confused about the syntax of argument specification in general. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Jul 15, 2021 at 2:09 AM Du

Re: [R] ls() pattern question

2021-07-14 Thread Bert Gunter
Actually fun( param != something..) is syntactically incorrect in the first place for any function! ls sees "pat != whatever" as the "name" argument of ls() and can't make any sense of it, of course. Bert Gunter "The trouble with having an open mind is that

Re: [R] density with weights missing values

2021-07-12 Thread Bert Gunter
t most would agree are inconsistent) may exist. This may be such a case. But, again, all you can do is follow the docs whether or not the behavior meets your "reasonable" expectations. Just my opinion, of course. Consume at your own risk. Bert Gunter "The trouble with having an

Re: [R] density with weights missing values

2021-07-12 Thread Bert Gunter
The behavior is as documented AFAICS. na.rm logical; if TRUE, missing values are removed from x. If FALSE any missing values cause an error. The default is FALSE. weights numeric vector of non-negative observation weights. NA is not a non-negative numeric. Bert Gunter "The tr

Re: [R] rWind: Error in if (is.numeric(v) && any(v < 0)) { : missing value where TRUE/FALSE needed

2021-07-11 Thread Bert Gunter
Further questions would be better sent to: https://stat.ethz.ch/mailman/listinfo/r-sig-geo Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Re: [R] error message from read.csv in loop

2021-07-10 Thread Bert Gunter
The whole of ?Quotes, especially the examples, is informative and worth the read (imo). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jul 10,

Re: [R] problem for strsplit function

2021-07-09 Thread Bert Gunter
"But it takes me a while to get familiar R." Of course. That is true for all of us. Just keep on plugging away and you'll get it. Probably far better than I before too long. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things in

Re: [R] problem for strsplit function

2021-07-09 Thread Bert Gunter
rns TRUE if x is a vector of the specified mode having no attributes other than names. It returns FALSE otherwise."). But I would say these issues are sufficiently murky that my warning to be precise is not entirely inappropriate; unfortunately, I may have made them more so. Sigh Cheers, B

Re: [R] problem for strsplit function

2021-07-09 Thread Bert Gunter
ocumentation, but others may prefer more extended expositions. I stand by this claim even if one chooses to use the "Tidyverse", data.table package, or other alternative frameworks for handling data. Again, others may disagree, but R is structured around these basics, and imo one remains ign

Re: [R] MAC version 10

2021-07-08 Thread Bert Gunter
If the below is not helpful, post on r-sig-mac rather than here. You should be able to download and install a precompiled binary (no zip files to unzip and compile) from here: https://cran.r-project.org/ Bert Gunter "The trouble with having an open mind is that people keep coming

Re: [R] problem for strsplit function

2021-07-07 Thread Bert Gunter
You would need to loop through the list to use strsplit() -- you are confused about list structure. Here's a simple way to do it using regex's -- **assuming that there is only one period in your names that delineates the extension.** If this is not true, then this **will fail**. This is

Re: [R] add a variable a data frame to sequentially count unique rows

2021-07-02 Thread Bert Gunter
Still can't makes sense of it. Shouldn't rows 5-7 have 3 for counts and rows 8-9 have 2? If not, then I give up trying to figure out what you mean. Maybe someone wlse can. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it.&quo

Re: [R] add a variable a data frame to sequentially count unique rows

2021-07-02 Thread Bert Gunter
Your example makes no sense (to me, anyway). Please check it carefully. Note that the count in rows 2 and 3 increment but the counts in rows 5-7 or rows 8-9 do not. So your specification seems inconsistent to me. Bert Gunter "The trouble with having an open mind is that people keep coming

Re: [R] concatenating columns in data.frame

2021-07-01 Thread Bert Gunter
- do.call(paste,c(df[,use_columns], sep = "_")) df In case you are wondering, this works because by definition *a date frame **is** a list*, so the concatenation is list concatenation. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking thi

Re: [R] Joining data frames

2021-06-29 Thread Bert Gunter
by: newdf <- merge(df1, df2, all = TRUE) ?merge gives you more info to get what you may want if I'm wrong. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic s

Re: [R] Constructing stacked bar plot

2021-06-27 Thread Bert Gunter
As has already been pointed out to you (several times, I believe) -- **HTML code is stripped on this *plain text* list**. Hence, "bolded, red code" is meaningless! Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it

Re: [R] dynamic panel data with weight

2021-06-26 Thread Bert Gunter
Have you looked here? https://cran.r-project.org/web/views/Econometrics.html Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jun 26,

Re: [R] Special characters in cell names

2021-06-23 Thread Bert Gunter
suggestion was indeed irrelevant. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Jun 23, 2021 at 2:39 PM Mahmood Naderan wrote: >

Re: [R] Special characters in cell names

2021-06-23 Thread Bert Gunter
names in back ticks usually works (maybe always works??). So for example: z<-data.frame (`a/b` = 1:5, y = 1:5, check.names = FALSE) plot(y ~ `a/b`, data = z) ## produces desired plot with correct label z ## yields: a/b y 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 Of course, ignore if this is

Re: [R] Plot NUTS regions with color

2021-06-23 Thread Bert Gunter
I suggest you post this in the r-sig-geo list rather than here. The expertise you seek is more likely to be there. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom Coun

Re: [R] How to spot/stop making the same mistake

2021-06-23 Thread Bert Gunter
quot;, "T", "True", "true", "tRue", "1") > as.logical(charvec) [1] FALSE FALSE FALSE FALSENANA TRUE TRUE TRUE TRUENANA > !!charvec Error in !charvec : invalid argument type Cheers, Bert Bert Gunter "The trouble

Re: [R] interactively getting alist of functions for a given package?

2021-06-23 Thread Bert Gunter
?ls and note the "pattern" argument. e.g. ls("package:base", pat =".*set.*") Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County&quo

Re: [R] Mediation analysis takes up all RAM, then all swap, and then RStudio/terminal suddenly closes

2021-06-22 Thread Bert Gunter
thz.ch/mailman/listinfo/r-sig-fedora , though of course I have no idea whether your problem is OS specific. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

Re: [R] Data is not properly written in csv file

2021-06-21 Thread Bert Gunter
eply or need further assistance. This applies to both requests for help and to bug reports." You may get lucky here and someone familiar with the tabulizer package will respond; but unless you have already done so and received no response -- in which case say so -- you should contact the maintain

Re: [R] Unexpected behaviour when using format(x, scientific = TRUE) on integer vector

2021-06-19 Thread Bert Gunter
r elements of a **real or complex vector** should be encoded in scientific format, or an integer penalty (see options("scipen")). Missing values correspond to the current default penalty. Your vector is integer, right? The options("scipen") man page also indicates that fixed format will

Re: [R] apply a color range (kind of like a heat map) to the values in each cell of a data frame

2021-06-18 Thread Bert Gunter
I haven't followed this closely, but you might wish to check the stats::image() function to see if it might give you what you want (perhaps with a little finagling). Feel free to ignore if you are happy with what you have. As Jim said, there are lots of functions in various packages that do this

Re: [R] Embedded R: Test if initialized

2021-06-16 Thread Bert Gunter
I believe this is the wrong list for this post. See the posting guide, linked below, for one that is more appropriate. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom Coun

Re: [R] Need to compare two columns in two data.frames and return all rows from df where rows values are missing

2021-06-14 Thread Bert Gunter
55 26e NA 0.1428000 27e NA 0.2164079 28e NA 0.1524447 29f NA 0.3181810 30f NA 0.1388061 Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-14 Thread Bert Gunter
e [1] TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE [14] FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE [27] TRUE TRUE TRUE TRUE FALSE TRUE > Fringe [1] TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

Re: [R] Need to compare two columns in two data.frames and return all rows from df where rows values are missing

2021-06-13 Thread Bert Gunter
... but I *think* merge(A, B, by = "name", all = TRUE) is what you want. Rows of NA's correspond to rows that were in one but not the other. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berk

Re: [R] Need to compare two columns in two data.frames and return all rows from df where rows values are missing

2021-06-13 Thread Bert Gunter
As always, a reprex would considerably improve the chances of a useful reply... See the posting guide linked below. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom Coun

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Bert Gunter
tations, then sequentially, one at a time, might be simpler. My judgments of computational efficiency are often wrong anyway. Note: I think my approach works, but I would appreciate an on-list response if I have erred. Also, even if correct, alternative cleverer approaches are always welcome. Cheers,

Re: [R] Identifying words from a list and code as 0 or 1 and words NOT on the list code as 1

2021-06-11 Thread Bert Gunter
in your core list allows such conflicts to arise. Do you claim that phrases would be chosen so that this can never happen? -- or what is your specification if they can (what constitutes a match and in what priority)? Bert Gunter "The trouble with having an open mind is that people keep comin

Re: [R] question re: tidycensus

2021-06-11 Thread Bert Gunter
eply or need further assistance. This applies to both requests for help and to bug reports." The "tidyverse" consists of contributed packages, so do not be surprised if you do not receive a response here. Of course, if you have contacted the maintainers, say so, but of course that doesn't gu

Re: [R] with replace na with 0?

2021-06-11 Thread Bert Gunter
reprex? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jun 11, 2021 at 7:23 AM Enrico Gabrielli < enricogabrielli76.per...@gmail.c

Re: [R] Merging multiple .csv files into one dataframe

2021-06-09 Thread Bert Gunter
I really think you need to create a simple reprex to show us what you want to do. In doing so, you may figure out how to get what you want. I suspect you may also need to spend some more time learning R -- following rote examples can be a fool's errand if you don't know the basics. Bert Gunter

Re: [R] aggregation of irregular interval time-series

2021-06-09 Thread Bert Gunter
d move on. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Jun 9, 2021 at 2:41 PM Rui Barradas wrote: > Hello, > &

Re: [R] Need help to fix the max date filter problem in the date input

2021-06-08 Thread Bert Gunter
I do not wish to be involved in this thread other than to note that you were, I believe, asked not to post in HTML. And because you did, you will find that "Bold" highlighting does not exist in your text below. I have no idea whether that matters for your query or not, but there it

Re: [R] .Last function in R 4.1.0

2021-06-07 Thread Bert Gunter
According to the News file for 4.1.0 -- you should always check there first for such things -- "The base environment and its namespace are now locked (so one can no longer add bindings to these or remove from these)." So the docs do seem to need updating. Bert Gunter "The trou

Re: [R] Beginner problem - using mod function to print odd numbers

2021-06-05 Thread Bert Gunter
y that one should try to work within the paradigms that are the language's strengths when possible, R's vectorization and indexing in this example. Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathe

Re: [R] shinyFiles update shinySaveButton filename varaible from server

2021-06-04 Thread Bert Gunter
ssistance. This applies to both requests for help and to bug reports." So do not be surprised if you do not get a response here. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his &quo

Re: [R] wanting to count instances of values in each cell of a series of simulated symmetric matrices of the same size

2021-06-01 Thread Bert Gunter
r ... ## You will *not*want to do this if you have lots of matrices: list_of_mats <- list(x,y) arr <- array(do.call(c,list_of_mats), dim = c(3,3,length(list_of_mats))) arr arr[2,3,] ## all the values in the [2,3] cell of the matrices; do whatever you want with them. Cheers, Bert Bert Gu

Re: [R] Binary data on JAGS

2021-06-01 Thread Bert Gunter
Unless you have got reason not to, always reply to the list (included in this response). I cannot help, but someone else may be able to. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in

Re: [R] Binary data on JAGS

2021-06-01 Thread Bert Gunter
Where is p defined before it is used? (Is this part of what jags provides somehow?) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Ju

Re: [R] Error: C stack usage 15924320 is too close to the limit

2021-05-29 Thread Bert Gunter
Please see the posting guide linked below. Questions about nonstandard packages are generally off topic here. You should probably do as the pg recommends and contact the maintainer, who you can find by the maintainer() function. Bert On Sat, May 29, 2021, 10:16 AM Gossaye Hailu wrote: > I am

Re: [R] R grep question

2021-05-28 Thread Bert Gunter
ne.all %in% match_strings > CRC$MMR.gene [1] TRUE FALSE TRUE FALSE Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, May 27, 2021 at 8:

Re: [R] multilabel classification XGBoost and hyperparameter tuning

2021-05-27 Thread Bert Gunter
gt; Do you have any other suggestion? > > Bye, > Agnes > > -- > *Van:* Bert Gunter > *Verzonden:* donderdag 27 mei 2021 16:44 > *Aan:* Agnes g2g > *CC:* r-help@r-project.org > *Onderwerp:* Re: [R] multilabel classification XGBoost and hyperparameter > tuning > &

Re: [R] multilabel classification XGBoost and hyperparameter tuning

2021-05-27 Thread Bert Gunter
roject.org/web/views/MachineLearning.html Cran's "task views" are a useful resource for such "does R have...?" questions. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in

Re: [R] Decompose df1 into another df2 based on values in df1

2021-05-26 Thread Bert Gunter
3 S4 S5 a1 1 0 0 0 0 a2 1 0 1 0 1 a3 0 0 0 0 1 b1 1 1 1 0 0 b3 1 0 1 0 0 b4 0 0 1 1 0 c1 0 0 1 0 0 c2 0 1 0 0 0 c4 0 0 1 1 0 Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it."

Re: [R] help to correct the function problem

2021-05-24 Thread Bert Gunter
This is a *plain text* list. I find your HTML (below) unreadable. I suggest you re-post to make it easier for others to help. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his &qu

Re: [R] Plotting Coxph model with an interaction.

2021-05-20 Thread Bert Gunter
Perhaps this might be useful: https://rpubs.com/tf_peterson/interactionplotDemo Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, May

Re: [R] Solving a quadratically constrained linear program with inital values

2021-05-17 Thread Bert Gunter
Have you looked here: https://cran.r-project.org/web/views/Optimization.html (Warning: I have no idea whether your query even makes mathematical sense.) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (ak

Re: [R] phylogenetic correction and MCMC model

2021-05-17 Thread Bert Gunter
Such specialized questions are usually better posted on appropriate R-sigs, in this case, https://stat.ethz.ch/mailman/listinfo/r-sig-phylo I presume. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkele

Re: [R] Wide to long format in R

2021-05-17 Thread Bert Gunter
I believe you'll need to show us exactly what bop.df looks like, e.g. via head(bop.df) . Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mo

Re: [R] Reg:K-Means cluster/Matrix Analysis

2021-05-15 Thread Bert Gunter
Sounds like homework. This list has a no homework policy. See the posting guide linked below, which says: "*Basic statistics and classroom homework:* R-help is not intended for these." Bert Gunter "The trouble with having an open mind is that people keep coming along and

Re: [R] No error message but don't get the 8 graphs

2021-05-09 Thread Bert Gunter
?getwd Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, May 9, 2021 at 2:59 PM varin sacha via R-help wrote: > Rui, > >

Re: [R] Analysing data with repeated measure variable

2021-05-06 Thread Bert Gunter
This looks like homework. We don't do homework on this list. To see what is done here, read and follow the posting guide linked below. If not homework, I think it is still very much out of bounds anyway, as you appear to be asking us to do your work for you. On Thu, May 6, 2021, 2:32 PM Ahmad

Re: [R] [MatchIt] Naive Estimator for ATT after Full Matching

2021-05-05 Thread Bert Gunter
first." The matchit package maintainer can be found by: maintainer("matchit") if you think the above applies. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in hi

Re: [R] Question

2021-05-01 Thread Bert Gunter
ta-analysis . Also per the posting guide, post in plain text not html. Not a problem here, but it can be when one posts code. Cheers, Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his &quo

<    1   2   3   4   5   6   7   8   9   10   >