. wonjong.moon  2008-03-26 10:26
Status: Closed
 
I am trying to print labkey.data in a html table format using R view.
I need to run for-loop in R view html, because the length of the data is not deteremined.
e,g., I want to print all date samples used according to a study ID.
for (var aNum = 0; aNum <= length(labkey.data$studyID); aNum++)
              document.write(labkey.data$dateSampleUsage);


Is it possible to pass R varilabe to html?
html does not support variables.
Does R view support java script?



txt <- paste(
"<TABLE border='1'><CAPTION><EM>A test table RNA Extraction Worksheet </EM></CAPTION>
<TR><TD>Patient: ",labkey.data$studyID[1],"<TD>Sample Day: ", labkey.data$sampleDate[1], "<TD>Extract Day: ", labkey.data$extractionDate[1], "<TD>Performed by: ", labkey.data$userInitials[1], "<TR><TD>Protocol: ", labkey.data$protocol[1], "<TD>Volume: ", labkey.data$voluL[1], "<TD>A260: ", labkey.data$a260[1],

"<TR><TD><img src='http://cpas01.sbri.org/files/Morogoro_RNA/bioan.jpg' HEIGHT=327 WIDTH=291>", "<TD>volLeft: ", labkey.data$volLeft[i],


 "</TABLE>",
"<SCRIPT LANGUAGE='JavaScript'>
    <!--
    document.write('<H2>Multiplication table for 4</H2>');
     
    for (var aNum = 0; aNum <= length(labkey.data$studyID); aNum++)
    {
      document.write('4 X ',aNum,' = ',4*aNum,'<BR>');
    }
    //-->
</SCRIPT>")
 
 
marki responded:  2008-03-26 10:35
Title: how to pass
I'm not sure what the question is here. You don't need the script block if you are just writing text to the output though.