I am sure I do not understand what you are trying to achieve.
To clarify the conversation I have made a reprex of your case.
The following file was knitted with the knit button in RStudio.
If this is not what you did then let us know.
---
title: "Untitled"
author: "My name"
date: "6/5/2020"
output: html_document
---
```{r cars}
x <- read.table(stdin(),header=T)
```
with result
processing file: DavidR.Rmd
Quitting from lines 9-10 (DavidR.Rmd)
Error in read.table(stdin(), header = T) : no lines available in input
Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> read.table
Execution halted
Where do you expect that the stdin function get its data from?
I think that the stdin normally get its data only from an interactive session or maybe a script.
Knitting with the knit button normally does not set up an interactive session.
Are you trying to do the knit with a script? If so share a small 'prototype' of the components of the script:
bat-file (assuming Windows), R-file and Rmd-file.
When you expect help from us you should give more information than 'it does not work but it should'