Watts-College / cpp-527-fall-2021

A course shell for CPP 527 Foundations of Data Science II
https://watts-college.github.io/cpp-527-fall-2021/
2 stars 6 forks source link

Lab6 Part I Step3 #50

Open WSKQ23 opened 2 years ago

WSKQ23 commented 2 years ago

Hello @lecy Having tried to run the build_circle() but I'm having error of function not found. Please help me with the package for build_circle() function.

Thanks

lecy commented 2 years ago

The function doesn't exist yet. Your task is to write a custom build_circle() function similar to the example:

name <- "RUBY TUESDAY"
title <- "TOP DOG" 

add_tags <- function( name, title )
{

  cat( paste0( '<tag> ', name, ' </tag>' ) )
  cat( '\n' )  # line break 
  cat( paste0( '<div class="title"> ', title, ' </div>' ) )
  cat( '\n' )  # line break

}

add_tags( name, title )  # test it: 
<tag> RUBY TUESDAY </tag>
<div class="title"> TOP DOG </div>

You need to replicate the template example in the assignment instructions but replacing hard-coded values with variables so that you can re-create the same table for any member.

<div class="list-circles-item">

    <a href="https://thibautjombart.netlify.com/"><img src="/img/people/thibaut-jombart.jpg" class="item-img"></a>

    <h4 class="item-name">Thibaut Jombart</h4>
    <div class="item-desc">Founder, President. Statistician and R programmer specialized in outbreak analysis. London School of Hygiene and Tropical Medicine / Imperial College London, UK.</div>

    <div class="item-links">

       <a class="item-link" href="https://thibautjombart.netlify.com/" title="Website">
       <span class="fa fa-home"></span>
       </a>

       <a class="item-link" href="https://github.com/thibautjombart/" title="GitHub">
       <span class="fa fa-github"></span>
       </a>

       <a class="item-link" href="https://twitter.com/TeebzR" title="Twitter">
       <span class="fa fa-twitter"></span>
       </a>

    </div>

</div>
lecy commented 2 years ago

You are inserting content into the div class. Look back over the examples - content should be between tags.

<div> CONTENT </div>
lecy commented 2 years ago

For icons follow this template instead of using the span tags:

GITHUB <- "https://github.com/thibautjombart/"
fa.github <- fontawesome::fa( name="github" )
paste0( '<a href="', GITHUB, '">', fa.github, '</a>' )