0

I am new to R.

  1. See code below. I have a list of R codes saved in an Excel sheet (Sheet1), cells F8:F100. After extracting the code in F8:F100 into a tibble. I would like to run each of the code. How do I do so?

I tried a workaround by saving the tibble into txt file with write.csv, but the txt file contains the row number of the tibble and the code are enclosed in ". So I can't run the txt file using source either.

  1. How do I remove rows in the tibble containing certain text. Eg "file100"

I am totally clueless. There isn't comprehensive explanation of Tibble on the web.

Thank you

library(readxl)
library(tabulizer)

read_excel('C:/Users/Desktop/test.xlsm', sheet='Sheet1', range = 'F8:F100',col_names=FALSE)

**Example of F8**
out<-extract_tables('C:/Users/Desktop/file1.pdf', method='stream',output='csv',outdir='C:/Users/Desktop/folder')
benson23
  • 16,369
  • 9
  • 19
  • 38
pp12345
  • 21
  • 2
  • Welcome to SO! To help us to help you could you please make your example reproducible by adding a snippet of your data or some example data? See [how to make a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – stefan Dec 30 '20 at 09:53
  • BTW: In my opinion there is no need to convert your data to a text file. To parse your codes have a look at `eval(parse(text = "CODE"))`, e.g. `eval(parse(text = "x <- 1; print(x)"))` – stefan Dec 30 '20 at 09:55
  • Can you provide example of your data along with expected output? If your dataframe is called `out` and you have a column called `col` in it , you can drop `'file100'` using `result <- subset(out, col != 'file100')` – Ronak Shah Dec 30 '20 at 10:32

0 Answers0