The R Project SVN R-packages

Rev

Rev 3509 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3509 Rev 3684
Line 42... Line 42...
42
factor or ordered var, even if two variables share the same level labels. Besides
42
factor or ordered var, even if two variables share the same level labels. Besides
43
storing the level data, it is used to mark a column as being a factor.}
43
storing the level data, it is used to mark a column as being a factor.}
44
}
44
}
45
 
45
 
46
SDF's are managed in a workspace separate from R's. When SQLiteDF is loaded, it searches
46
SDF's are managed in a workspace separate from R's. When SQLiteDF is loaded, it searches
47
for the file \code{workspace.db} in the current working directory. This file contains
47
for the file \code{workspace.db} inside the subdirectory \code{.SQLiteDF} in the current 
-
 
48
working directory. This file contains
48
a list of SDF's created/used in the previous session (i.e. SQLiteDF sessions are automatically
49
a list of SDF's created/used in the previous session (i.e. SQLiteDF sessions are automatically
49
saved), including their full and relative path and attach information. 
50
saved), including their full and relative path and attach information. 
50
Workspace is managed using the SQLite engine
51
Workspace is managed using the SQLite engine
51
by opening \code{workspace.db} as the main database and then attaching (SQLite's attach) the SDF's.
52
by opening \code{workspace.db} as the main database and then attaching (SQLite's attach) the SDF's.
52
Unfortunately, the number of attached databases is limited to 31 (actually 32, but 1 is reserved
53
Unfortunately, the number of attached databases is limited to 31 (actually 32, but 1 is reserved
53
for the temp db). Therefore, SDF's are \emph{scored} according to the number of times
54
for the temp db). Therefore, SDF's are \emph{scored} according to the number of times
54
it has been used. When the maximum allowed attachment is reached, the least used attached
55
it has been used. When the maximum allowed attachment is reached, the least used attached
55
SDF's is detached and the needed one is attached in its place. The packaged SQLite3 static library 
56
SDF's is detached and the needed one is attached in its place. On compiling the package, the
-
 
57
configure script modifies the bundled SQLite source such that
56
has been modified to have 31 maximum attachments, because the default is 10. 
58
constant controlling the maximum attachments is modified to 31 (default is 10).
57
 
59
 
58
Back to when SQLiteDF is loaded, after opening \code{workspace.db}, the SDF's stored in the list
60
Back to when SQLiteDF is loaded, after opening \code{workspace.db}, the SDF's stored in the list
59
are sorted according to their number of uses in the previous session and then the 
61
are sorted according to their number of uses in the previous session and then the 
60
first 30 are attached. The relative path is used for finding the SDF file. If the file
62
first 30 are attached. The relative path is used for finding the SQLite file. If the file
61
cannot be found, it is deleted from the SQLiteDF workspace (with a warning message). The
63
cannot be found, it is deleted from the SQLiteDF workspace (with a warning message). The
62
scores are then all reset.
64
scores are then all reset.
63
 
65
 
64
A sqlite.data.frame object is a list a single element:
66
A sqlite.data.frame object is a list a single element:
65
\itemize{
67
\itemize{
Line 68... Line 70...
68
and the following attributes:
70
and the following attributes:
69
\itemize{
71
\itemize{
70
\item{class}{The S3 class vector \code{c("sqlite.data.frame", "data.frame")}}
72
\item{class}{The S3 class vector \code{c("sqlite.data.frame", "data.frame")}}
71
\item{row.names}{A sqlite.vector of mode character containing the row names of the SDF}
73
\item{row.names}{A sqlite.vector of mode character containing the row names of the SDF}
72
}
74
}
-
 
75
 
-
 
76
All SDF's created in the session will have their SQLite file stored in the subdirectory .SQLiteDF in the
-
 
77
current working directory. SDF's created in the other session can be imported/attached
-
 
78
to the current SDF workspace using \code{attachSdf}, which may reside anywhere in the
-
 
79
file system. 
73
}
80
}
74
\value{
81
\value{
75
A S3 object representing the SDF. The SDF database will be created in the same directory
82
A S3 object representing the SDF. The SDF database will be created in the same directory
76
with file name derived by appending the extension \emph{db} to the passed internal
83
with file name derived by appending the extension \emph{db} to the passed internal
77
name, or the default internal name if none is provided.
84
name, or the default internal name if none is provided.