Problems with RODBC sqlSave

后端 未结 6 904
轻奢々
轻奢々 2021-02-14 17:39

I\'m having some difficulty inserting a data frame into a mySql database using RODBC. Below is the code I\'m using:

data <- data.frame(analysedDataID=c(1,2,3         


        
6条回答
  •  难免孤独
    2021-02-14 18:23

    > str(data)
    'data.frame':   3 obs. of  4 variables:
     $ analysedDataID  : num  1 2 3
     $ plateWell       : Factor w/ 3 levels "a","b","c": 1 2 3
     $ screenPlateOrder: num  1 2 3
     $ wellData        : Factor w/ 3 levels "A","B","C": 1 2 3
    

    Have you tried making your numerics integers and your factors characters?

     data <- data.frame(analysedDataID=as.integer(c(1,2,3)), plateWell=c("a","b","c"), screenPlateOrder=as.integer(c(1,2,3)), wellData=c("A","B","C"),stringsAsFactors=FALSE)
    

提交回复
热议问题