String manipulation in R with regular expressions using stringr and glue (CC111)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ก.ย. 2024

ความคิดเห็น • 24

  • @Riffomonas
    @Riffomonas  3 ปีที่แล้ว +3

    See if you can figure out how to make the OTU label in the final figure bolded while keeping the taxon names italicized. Let us know if you figure it out!

  • @brendenmorley2643
    @brendenmorley2643 2 ปีที่แล้ว +1

    Thanks!

    • @Riffomonas
      @Riffomonas  2 ปีที่แล้ว

      My pleasure! Thanks for watching Brendan

  • @ahmed007Jaber
    @ahmed007Jaber ปีที่แล้ว +1

    thank u for this again Pat. Just learnt a bit more now about html items.
    i was doing some text mining and had to use the below approach but had an issue with getting qunatifiers work with glue
    str_glue(" (?

    • @Riffomonas
      @Riffomonas  ปีที่แล้ว

      Thanks for watching! I suspect it's because the curly braces - {} - are special with glue. I suspect you could use "\{2,3\}" to avoid this problem

    • @ahmed007Jaber
      @ahmed007Jaber ปีที่แล้ว

      @@Riffomonas still same issue; i am experimenting with other things to try get it working

    • @Riffomonas
      @Riffomonas  ปีที่แล้ว

      @@ahmed007Jaber I just looked at ?glue. Check out the very last example where you can use alternatives to {} to insert variables. one

    • @ahmed007Jaber
      @ahmed007Jaber ปีที่แล้ว

      @@Riffomonas thank you, it works like magic, and same concept can be used with str_glue()
      this is amazing! keep up the good work Pat!

  • @jamesleleji6984
    @jamesleleji6984 ปีที่แล้ว

    How do you replace a string across different column names?

  • @sven9r
    @sven9r 3 ปีที่แล้ว +1

    The bug you introduces is the comma instead of an additional pipe ( wrote comment at 15:50) :D

    • @Riffomonas
      @Riffomonas  3 ปีที่แล้ว

      Good eye 😊 a moment later I removed the mutate so I only needed one mutate separating the variable assignments with a comma. It was the end of the day. I was tired 😂

  • @meseretmuche6984
    @meseretmuche6984 ปีที่แล้ว +1

    Really thank you for your help and remarkable lectures.
    if you have a video of meta analysis for continuous data, kindly request to share us

    • @Riffomonas
      @Riffomonas  ปีที่แล้ว +1

      Hi there - sorry I don't have anything at this point. I'll keep my eyes out looking for something

  • @meseretmuche6984
    @meseretmuche6984 ปีที่แล้ว +1

    remarkable

  • @GabrielMorenoHagelsieb
    @GabrielMorenoHagelsieb 3 ปีที่แล้ว +1

    I obsess over having italics and non italics right, so, let's see how to do this in R!

    • @Riffomonas
      @Riffomonas  3 ปีที่แล้ว

      Fantastic! Thanks for tuning in Gabriel 😊

  • @parwana-e-aatish9641
    @parwana-e-aatish9641 3 ปีที่แล้ว

    Thank you for uploading a wonderful tutorial.
    I have a query that how we can plot two variables data on single map.
    Like :
    ggplot() +
    geom_sf(data=shape, color='grey20', size=0.1, fill=NA) +
    geom_sf(data = subset(clus_dzc1, type=='high'),aes(fill=CL2),size=0.1,color='black') +
    scale_fill_discrete_sequential(palette='Burg',name="High-risk",rev=FALSE,
    guide = guide_legend(ncol=2)) +
    theme_void()
    ggplot() +
    geom_sf(data=shape, color='grey20', size=0.1, fill=NA) +
    geom_sf(data = subset(clus_dzc1, type=='low'),aes(fill=CL2), size=0.1, color='black') +
    scale_fill_discrete_sequential(palette='Blues',name="Low-risk",rev=FALSE,
    guide = guide_legend(ncol=2)) +
    theme_void()
    . There are two plots code. Can you please guide me, how i can convert into one gg plot. Can you please write the code for me.
    I shall be very thankful to you.

    • @Riffomonas
      @Riffomonas  3 ปีที่แล้ว

      You can't map two variables to the same aesthetic. That typically means that you're trying to do too much with your visualization. Do you have an example of what such a plot would look like that you can link to?

    • @parwana-e-aatish9641
      @parwana-e-aatish9641 3 ปีที่แล้ว

      @Riffomonas Project yeah i have an example. Could you please share here email address. I send you all of material via email. If you dont mind