Hi Jeff,
The code you show is exactly what I usually do, in base R; but I wanted
to play with tidyverse to learn it (and also understand when it makes
sense and when it doesn't).
And yes, of course, in the example I gave, I end up with a 1-cell
tibble, which could be better extracted as a length-
Dear Chris,
I didn't think about having the assignment at the end as you showed; it
indeed fits the pipe workflow better.
By "easy", I actually meant shorter. As you said, in base R, I usually
do that in 1 line, so I was hoping to do the same in tidyverse. But I'm
glad to hear that I'm using tidy
Thank you all for all the very helpful answers!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www
There are & and | operators in the R language.
There is an | operator in regular expressions.
There is NOT any & operator in regular expressions.
grep("ConfoMap&GuineaPigs", mydata, value=TRUE)
looks for elements of mydata containing the literal
string 'ConfoMap&GuineaPigs'.
> foo <- c("a","b","ca
Hi Paul,
I ran this:
library(qcc)
pareto.chart(dataset2$Points)
and like you, got the chart. As you have 140 long labels, I thought at
first it might be the function trying to abbreviate some of them and
actually displaying about 1 in 5. Looking at the code for the
function, this is not the case.
Dear Paul, I answer inline:
On 2020-08-19 16:27 -0500, Paul Bernal wrote:
|
| I tried using the function
| pareto.chart from the qcc package, but
| the names of the columns in the pareto
| chart are some codes
What codes? Can you please elaborate on
this?
| that do not match the school n
On Wed, Aug 19, 2020 at 7:53 AM Ivan Calandra wrote:
|
| I have the following vector:
| mydata <-
| c("SSFA-ConfoMap_GuineaPigs_NMPfilled.csv",
| "SSFA-ConfoMap_Lithics_NMPfilled.csv",
| "SSFA-ConfoMap_Sheeps_NMPfilled.csv",
| "SSFA-Toothfrax_GuineaPigs.xlsx",
|
Dear friends,
Hope you are doing well. I am currently using R version 3.6.2. I installed
and loaded package qcc by Mr. Luca Scrucca.
This is the structure of my data:
str(dataset2)
'data.frame': 140 obs. of 2 variables:
$ School: Factor w/ 140 levels "24 de Diciembre",..: 39 29 66 16 67 116
The whole point of dplyr primitives is to support data frames... that is, lists
of columns. When you pare your data frame down to one column you are almost
certainly using the wrong tool for the job.
So, sure, your code works... and it even does what you wanted in the dplyr
style, but what a po
Inline
- Original Message -
> From: "Ivan Calandra"
> To: "R-help"
> Sent: Wednesday, 19 August, 2020 16:56:32
> Subject: [R] combine filter() and select()
> Dear useRs,
>
> I'm new to the tidyverse world and I need some help on basic things.
>
> I have the following tibble:
> mytbl <
Instead of intersect you could use grepl(pattern1,x) &
grepl(pattern2,x). Use which() on the result if you must have
integers, but the logicals that grepl() produces are often easier to
use as subscripts.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Aug 19, 2020 at 8:54 AM Ivan Calandra
A version of Eric's answer is to use grepl(), which returns a logical vector:
mydata[grepl("ConfoMap", mydata) & grepl("GuineaPigs", mydata)]
with the OR analogue:
mydata[grepl("ConfoMap", mydata) | grepl("GuineaPigs", mydata)]
/Henrik
On Wed, Aug 19, 2020 at 8:24 AM Ivan Calandra wrote:
>
>
Indeed!
I was just hoping that there would be a shorter way... intersect() is a
nice alternative too. Maybe I can make it work with pipes so that I
don't have to repeat "mydata" but that's another story.
Thank you for the help!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Contr
Well... wouldn't it be:
rep("(ConfoMap.*GuineaPigs)|(GuineaPigs.*ConfoMap)", mydata, value=TRUE)
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 19, 2
Thank you Bert for the pointer.
So I guess the solution is:
grep("ConfoMap.+GuineaPigs", mydata, value=TRUE)
This is not the case here, but what if "GuineaPigs" comes before
"ConfoMap"?
Of course I could do two "grep()" calls, but if there a better solution?
Ivan
--
Dr. Ivan Calandra
TraCEr, la
Thank you Eric, I didn't think about intersect().
Now I'm trying to do that in tidyverse with pipes, and I think that's
too much for me for now!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Beh
mydata[ intersect( grep("ConfoMap", mydata), grep("GuineaPigs", mydata) ) ]
On Wed, Aug 19, 2020 at 6:13 PM Bert Gunter wrote:
> "&" is not a regex metacharacter.
> See ?regexp
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things int
"&" is not a regex metacharacter.
See ?regexp
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 19, 2020 at 7:53 AM Ivan Calandra wrote:
> Dear useRs,
Dear useRs,
I'm new to the tidyverse world and I need some help on basic things.
I have the following tibble:
mytbl <- structure(list(files = c("a", "b", "c", "d", "e", "f"), prop =
1:6), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"))
I want to subset the rows with "a" in the
Dear useRs,
I feel really stupid, but I cannot understand why "&" doesn't work as I
expect, while "|" does.
I have the following vector:
mydata <- c("SSFA-ConfoMap_GuineaPigs_NMPfilled.csv",
"SSFA-ConfoMap_Lithics_NMPfilled.csv",
"SSFA-ConfoMap_Sheeps_NMPfilled.csv", "SSFA-Toothfrax_GuineaPigs.x
Dear Stephen,
I answer inline:
On 2020-08-19 12:57 +1000, Jim Lemon wrote:
| On Wed, Aug 19, 2020 at 3:09 AM Stephen P. Molnar
wrote:
| |
| | What I would like to do is use
| | linetype, rather than color, in line
| | 27.
You need to specify linetype instead of
color in ggplot::aes, like so
Eric,
you are right! If I run the code on a different instance, it works.
There must be something in my old R environment that messed this up.
Thank you very much for checking this out.
Best,
Valerio
On Wed, Aug 19, 2020 at 11:36 AM Eric Berger wrote:
>
> Hi Valerio,
> I did a copy-paste on your
Hi Valerio,
I did a copy-paste on your reproducible example and I had no problem with
chol(nls.out$hessian).
In addition to summary() you can look at str() to display the structure of
any R object.
> str(nls.out)
List of 9
$ par :List of 3
..$ a: num 8.99
..$ b: num -1.01
..$ c: num 6.
Dear R users,
I want to modify how the degrees of freedom are calculated from the
summary function of the package minpack.lm
My first thought was to replicate how minpack.lm:::summary.nls.lm
works, and modify the line of the code that is relevant for my task.
However, for some reason I am not able
Hi Prasad,
I think this might be a problem with the package, and you can try to
contact the package author.
The error seem to arise because the pcr() cannot find the
'negative-binomial' distribution
```
library(qualityTools)
x <- rnbinom(500, mu = 4, size = 100)
pcr(x, distribution = "negat
25 matches
Mail list logo