0

So I recently helped write a code for my lab which takes our processed data and makes a merged data frame of it. For purpose of keeping the lab updated, we keep our data tables updated on a secure wiki and thus I need an HTML made so I can basically upload the dataframe onto the wiki easily. It's worked before - all I did was basically copy what was already written and working and edited it to work for a different time point in our data collection. I have no errors given back to me and the data looks how I want it to look. As far as I know this script should be written logically and working well and so far it does except for one issue: R will make a file for the HTML, but there is no HTML written in the text document.

I have HTML's written from the other data time points which are written the exact same as this one, so I don't think it is a script construction thing.

Any ideas as to why this could be happening? I just need to know where to triage.

The package used for HTML is R2HTML, included in my packages list up at the top of the script. For HTML(, file=paste()), you will need to use your own directory to see if the HTML is written as a text file.

  • 2
    You need to post reproducible, self-contained code. Drop anything that isn't necessary to show the problem, but make sure we can run it. – user2554330 May 11 '20 at 18:50
  • 2
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Where is the `HTML` function from? What type of HTML are you expecting exactly? – MrFlick May 11 '20 at 18:51

1 Answers1

0

If I am not wrong , You are trying to get the dataframe in html format .
In this case you need to use xtable package in R

Just the below code in bottom of the script

## install the xtable package before importing it
library("xtable")

print(xtable(ChildSRPtotsFU_wiki), type="html", file="check_stack_overflow.html")
Mukesh Kumar Singh
  • 623
  • 1
  • 10
  • 18
  • Yeah I am trying to get the dataframe in HTML format. But, the method you suggested doesn't seem to print anything for me, nor can I find an HTML file made –  May 11 '20 at 19:44
  • what is the file name you are using ? can you paste it here exactly as you have written – Mukesh Kumar Singh May 11 '20 at 19:48
  • child FUSRPsum_2020-05-11.txt - it is only a txt because the HTML code was supposed to be pasted in the txt file using the R2HTML function HTML() –  May 11 '20 at 19:58
  • It is creating the txt file for me , Try pasting the complete system path and run the code . for example : C:/Users/Mona/Documents/child FUSRPsum_2020-05-11.txt . Also remove the HTML line from your code – Mukesh Kumar Singh May 11 '20 at 20:05