@@ -96,68 +96,64 @@ MatchName <- function(nom, pattern, match.author=.BibOptions$match.author,
9696# ' @family operators
9797# ' @rdname SearchBib
9898# ' @examples
99- # ' if (requireNamespace("bibtex")) {
100- # ' file.name <- system.file("Bib", "biblatexExamples.bib", package="RefManageR")
101- # ' bib <- suppressMessages(ReadBib(file.name))
99+ # ' file.name <- system.file("Bib", "biblatexExamples.bib", package="RefManageR")
100+ # ' bib <- suppressMessages(ReadBib(file.name))
102101# '
103- # ' ## author search, default is to use family names only for matching
104- # ' bib[author = "aristotle"]
102+ # ' ## author search, default is to use family names only for matching
103+ # ' bib[author = "aristotle"]
105104# '
106- # ' ## Aristotle references before 1925
107- # ' bib[author="aristotle", date = "/1925"]
105+ # ' ## Aristotle references before 1925
106+ # ' bib[author="aristotle", date = "/1925"]
108107# '
109- # ' ## Aristotle references before 1925 *OR* references with editor Westfahl
110- # ' bib[list(author="aristotle", date = "/1925"),list(editor = "westfahl")]
108+ # ' ## Aristotle references before 1925 *OR* references with editor Westfahl
109+ # ' bib[list(author="aristotle", date = "/1925"),list(editor = "westfahl")]
111110# '
112- # ' ## Change some searching and printing options and search for author
113- # ' old.opts <- BibOptions(bib.style = "authoryear", match.author = "exact",
114- # ' max.names = 99, first.inits = FALSE)
115- # ' bib[author="Mart\u00edn, Jacinto and S\u00e1nchez, Alberto"]
116- # ' BibOptions(old.opts) ## reset options
111+ # ' ## Change some searching and printing options and search for author
112+ # ' old.opts <- BibOptions(bib.style = "authoryear", match.author = "exact",
113+ # ' max.names = 99, first.inits = FALSE)
114+ # ' bib[author="Mart\u00edn, Jacinto and S\u00e1nchez, Alberto"]
115+ # ' BibOptions(old.opts) ## reset options
117116# '
118- # ' ## Some works of Raymond J. Carroll's
119- # ' file.name <- system.file("Bib", "RJC.bib", package="RefManageR")
120- # ' bib <- ReadBib(file.name)
121- # ' length(bib)
117+ # ' \dontrun{
118+ # ' ## Some works of Raymond J. Carroll's
119+ # ' file.name <- system.file("Bib", "RJC.bib", package="RefManageR")
120+ # ' bib <- ReadBib(file.name)
121+ # ' length(bib)
122122# '
123- # ' ## index by key
124- # ' bib[c("chen2013using", "carroll1978distributions")]
123+ # ' ## index by key
124+ # ' bib[c("chen2013using", "carroll1978distributions")]
125125# '
126- # ' ## Papers with someone with family name Wang
127- # ' length(SearchBib(bib, author='Wang', .opts = list(match.author = "family")))
126+ # ' ## Papers with someone with family name Wang
127+ # ' length(SearchBib(bib, author='Wang', .opts = list(match.author = "family")))
128128# '
129- # ' ## Papers with Wang, N.
130- # ' length(SearchBib(bib, author='Wang, N.', .opts = list(match.author = "family.with.initials")))
129+ # ' ## Papers with Wang, N.
130+ # ' length(SearchBib(bib, author='Wang, N.', .opts = list(match.author = "family.with.initials")))
131131# '
132- # ' ## tech reports with Ruppert
133- # ' length(bib[author='ruppert',bibtype="report"])
132+ # ' ## tech reports with Ruppert
133+ # ' length(bib[author='ruppert',bibtype="report"])
134134# '
135- # ' ##Carroll and Ruppert tech reports at UNC
136- # ' length(bib[author='ruppert',bibtype="report",institution="north carolina"])
135+ # ' ##Carroll and Ruppert tech reports at UNC
136+ # ' length(bib[author='ruppert',bibtype="report",institution="north carolina"])
137137# '
138- # ' ## Carroll and Ruppert papers since leaving UNC
139- # ' length(SearchBib(bib, author='ruppert', date="1987-07/",
140- # ' .opts = list(match.date = "exact")))
141- # ' }
138+ # ' ## Carroll and Ruppert papers since leaving UNC
139+ # ' length(SearchBib(bib, author='ruppert', date="1987-07/",
140+ # ' .opts = list(match.date = "exact")))
142141# '
143- # ' ## Carroll and Ruppert papers NOT in the 1990's
144- # ' \dontrun{
145- # ' if (requireNamespace("bibtex")) {
146- # ' length(SearchBib(bib, author='ruppert', date = "!1990/1999"))
147- # ' identical(SearchBib(bib, author='ruppert', date = "!1990/1999"),
148- # ' SearchBib(bib, author='ruppert', year = "!1990/1999"))
149- # ' table(unlist(SearchBib(bib, author='ruppert', date="!1990/1999")$year))
142+ # ' ## Carroll and Ruppert papers NOT in the 1990's
143+ # ' length(SearchBib(bib, author='ruppert', date = "!1990/1999"))
144+ # ' identical(SearchBib(bib, author='ruppert', date = "!1990/1999"),
145+ # ' SearchBib(bib, author='ruppert', year = "!1990/1999"))
146+ # ' table(unlist(SearchBib(bib, author='ruppert', date="!1990/1999")$year))
150147# '
151- # ' ## Carroll + Ruppert + Simpson
152- # ' length(bib[author="Carroll, R. J. and Simpson, D. G. and Ruppert, D."])
148+ # ' ## Carroll + Ruppert + Simpson
149+ # ' length(bib[author="Carroll, R. J. and Simpson, D. G. and Ruppert, D."])
153150# '
154- # ' ## Carroll + Ruppert OR Carroll + Simpson
155- # ' length(bib[author=c("Carroll, R. J. and Ruppert, D.", "Carroll, R. J. and Simpson, D. G.")])
151+ # ' ## Carroll + Ruppert OR Carroll + Simpson
152+ # ' length(bib[author=c("Carroll, R. J. and Ruppert, D.", "Carroll, R. J. and Simpson, D. G.")])
156153# '
157- # ' ## Carroll + Ruppert tech reports at UNC "OR" Carroll and Ruppert JASA papers
158- # ' length(bib[list(author='ruppert',bibtype="report",institution="north carolina"),
159- # ' list(author="ruppert",journal="journal of the american statistical association")])
160- # ' }
154+ # ' ## Carroll + Ruppert tech reports at UNC "OR" Carroll and Ruppert JASA papers
155+ # ' length(bib[list(author='ruppert',bibtype="report",institution="north carolina"),
156+ # ' list(author="ruppert",journal="journal of the american statistical association")])
161157# ' }
162158`[.BibEntry` <- function (x , i , j , ... , drop = FALSE ){
163159
0 commit comments