[R] extracting pdf tables...

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Sun Apr 9 20:27:36 CEST 2023


Sorry, did not read closely enough.

Did you want rbind (which has no problem with different numbers of rows) or merge (which requires that there be key columns that can be aligned by repeating data)?

On April 9, 2023 10:49:09 AM PDT, Jeff Newmiller <jdnewmil using dcn.davis.ca.us> wrote:
>Clearly the column names are different. You need to decide what to do about that. Choose the subset of dataframes where the column names are the same? Rename columns? Omit some columns? Add missing columns filled with NA?
>
>On April 9, 2023 10:22:32 AM PDT, akshay kulkarni <akshay_e4 using hotmail.com> wrote:
>>Dear members,
>>                             I am extracting a pdf table by the following code:
>>
>>> library(tabulizer)
>>> IDT <- extract_tables("https://www.canmoney.in/pdf/INTRADAYLEVERAGE-20220531-latest.pdf",output = "data.frame")
>>
>>It returns 4 different data frames which I want to combine them and make one data frame. But when I run this:
>>
>>> rbind(IDT[[1]],IDT[[2]],IDT[[3]],IDT[[4]])
>> Error in match.names(clabs, names(xi)) :
>>names do not match previous names
>>
>>Also:
>>
>>> class(IDT[[1]])
>>[1] "data.frame"
>>
>>> cbind(IDT[[1]],IDT[[2]],IDT[[3]],IDT[[4]],make.row.names = FALSE)
>> Error in data.frame(..., check.names = FALSE) :
>>arguments imply differing number of rows: 55, 56, 30, 1
>>
>>Can anyone please help me to combine all these 4 different data frames?
>>
>>Thanking you,
>>Yours sincerely,
>>AKSHAY M KULKARNI
>>
>>	[[alternative HTML version deleted]]
>>
>>______________________________________________
>>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.
>

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list