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

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 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

  • @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 2 года назад +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  2 года назад +1

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

  • @jamesleleji6984
    @jamesleleji6984 2 года назад

    How do you replace a string across different column names?

  • @ahmed007Jaber
    @ahmed007Jaber 2 года назад +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  2 года назад

      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 2 года назад

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

    • @Riffomonas
      @Riffomonas  2 года назад

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

    • @ahmed007Jaber
      @ahmed007Jaber 2 года назад

      @@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!

  • @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

  • @meseretmuche6984
    @meseretmuche6984 2 года назад +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 😊