课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

RSQLite

RSQLite

- [Instructor] During the course of your research, there are times where you are going to want to store data and keep it persistent. An excellent way to do this is to use RSQLite. And heres how to use that with R. The first thing you need to do is install a couple of packages. A DBI and RSQLite. I'll go ahead and hit return for install packages. And then I need to load them into the library. Now I'm ready to start using RSQLite. The first thing I need to do is create a connection in a database to an SQLite database. I'll use the dbConnect command to do that. And I specify that I want to create a SQLite database and the file name I'm going to create is myRSQLite.sqlite. So I select that line and then I hit command return. And I've returned mySQLiteDB, which is a connection to that database I've just created. I want to put some data into that database. Let's use the chick weight data. And to put information into it, I'm going to use the dbwritetable command. And I need to tell it a…

内容