I am new in R and i have searched for similar problem and coulnd't find an answer.sorry if cross posting please refer to correct link please.
I have one 2 csv files. 1-Bm with 86 rows and 2 columns.
BM <- read.csv('Z:/R_CGV/alB.csv', header = FALSE)
2nd - BG with 80 rows and 14 columns.
BG <- read.csv('Z:/R_CGV/BG111.csv', header = FALSE)
I need to go through BM file and where (BM's 1st column content equlas to 12th col in BG file)BM[,1]=BG[i,1] want to extract 2nd colums contents.
library(sqldf)
BM <- read.csv('Z:/R_CGV/alB.csv', header = FALSE)
BG <- read.csv('Z:/R_CGV/BG111.csv', header = FALSE)
len_BM <- length(BM)
csNu <- BG[,12]
for (i in len_BM)
BnNam <- BM[i:len_BM,1]
{
RetC_BN <- read.csv.sql("alB.csv", sql="select * from BM where csNu=BnNam")
}
It throughs me error:
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: no such column: csNu)
I checked with keywords and tried to change names but nothing helps. What am I missing here?
example of BM (../alB.csv) file:
10 3
23 4
37 3
# more lines
86 5
Example of BG (.../BG111.csv') file:
10 41.16 1 0.36 47 0.94 49 26.83 26.83 1 0.3249 0.63 49 26.83
100 40.62 0 0.11 55 0.95 107 33.62 42.25 0 0.117 109 0.64 107 33.62
# more lines
101 29.75 0 0.082 111 0.91 107 12.62 29.75 0 0.08 111 0.88 107 12.62
Many thanks, Mil'