R Report - How to use variables

LabKey Support Forum
R Report - How to use variables marcia hon  2018-02-20 11:59
Status: Closed
 
Hello,

I was able to do this:

participant <- labkey.data$participantid;
visit <- labkey.data$visitid;

My question is how do I use these variables in html? For example:

<b>participant[1]</b>

??

Thanks,
Marcia
 
 
marcia hon responded:  2018-02-20 12:26
It's okay, I figured it out:


<b>Interpretation:</b>
<center>
```{r, echo=FALSE}
part <- labkey.data$participantid;
dna <- labkey.data$dnaconcentration;
```
<table width="70%" border="1" style="border-collapse: collapse;">
   <tr>
       <td align="center">
           <b>Gene Variant</b>
       </td>
       <td align="center">
           <b>Genotype</b>
       </td>
   </tr>
   <tr>
       <td align="center">
           <b>
            `r part[1]`
        </b>
       </td>
       <td align="center">
           <b>
            `r dna[1]`
        </b>
       </td>
   </tr>
   <tr>
       <td align="center">
           <b>
            `r part[2]`
        </b>
       </td>
       <td align="center">
           <b>
            `r dna[2]`
        </b>
       </td>
   </tr>
</table>
</center>