Hi, I 'd like to create a table for literature review. Is there any good data structure (database) I may use? Now I just use a simple dataframe as follows, but in the second item I swap the order of year and author, and it records 2013 as author and "XH" as year. Is there any better structure ? If not, how may I fix the current condition?Thanks! df <- data.frame(author = NA, year = NA, title = NA, country = NA, sample NA, data = NA, result = NA, note = NA, stringsAsFactors=FALSE) df[1, ]<-c( author = "Moore", year = 2020, title = "Statistics and data analysis", country = "Colombia", sample = NA, data = "firm level", result = NA, note = NA) df[nrow(df)+1,]<- c(year = 2013, author = "XH", title = NA, country = NA, sample = NA, data = NA, result = NA, note = NA) [[alternative HTML version deleted]]
On 04/11/2020 4:22 a.m., John wrote:> Hi, > > I 'd like to create a table for literature review. Is there any good > data structure (database) I may use? Now I just use a simple dataframe as > follows, but in the second item I swap the order of year and author, and it > records 2013 as author and "XH" as year. Is there any better structure ? > If not, how may I fix the current condition?Thanks! > > > df <- data.frame(author = NA, year = NA, title = NA, country = NA, sample > NA, data = NA, result = NA, note = NA, stringsAsFactors=FALSE) > df[1, ]<-c( > author = "Moore", > year = 2020, > title = "Statistics and data analysis", > country = "Colombia", > sample = NA, > data = "firm level", > result = NA, > note = NA) > > df[nrow(df)+1,]<- c(year = 2013, > author = "XH", > title = NA, > country = NA, > sample = NA, > data = NA, > result = NA, > note = NA)If you changed the last statement to df <- rbind(df, data.frame(year = 2013, author = "XH", title = NA, country = NA, sample = NA, data = NA, result = NA, note = NA)) it would correctly sort out the reordered columns. As to a better data structure: bibliographic data is hard, because different forms of publication should have different fields. I'd suggest storing the data in some existing format rather than rolling your own. For example, the utils::bibentry function is quite a bit like BibTeX. Duncan Murdoch
I agree with Duncan. I co-ordinated a large literature review with initially more than 5000 papers and about 30 reviewers, and all the bibliometrics information was in bibtex format, as it is easy to interchange between programs. Cheers, Rainer> On 4 Nov 2020, at 10:28, Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 04/11/2020 4:22 a.m., John wrote: >> Hi, >> I 'd like to create a table for literature review. Is there any good >> data structure (database) I may use? Now I just use a simple dataframe as >> follows, but in the second item I swap the order of year and author, and it >> records 2013 as author and "XH" as year. Is there any better structure ? >> If not, how may I fix the current condition?Thanks! >> df <- data.frame(author = NA, year = NA, title = NA, country = NA, sample >> NA, data = NA, result = NA, note = NA, stringsAsFactors=FALSE) >> df[1, ]<-c( >> author = "Moore", >> year = 2020, >> title = "Statistics and data analysis", >> country = "Colombia", >> sample = NA, >> data = "firm level", >> result = NA, >> note = NA) >> df[nrow(df)+1,]<- c(year = 2013, >> author = "XH", >> title = NA, >> country = NA, >> sample = NA, >> data = NA, >> result = NA, >> note = NA) > > If you changed the last statement to > > df <- rbind(df, data.frame(year = 2013, > author = "XH", > title = NA, > country = NA, > sample = NA, > data = NA, > result = NA, > note = NA)) > > it would correctly sort out the reordered columns. > > As to a better data structure: bibliographic data is hard, because different forms of publication should have different fields. I'd suggest storing the data in some existing format rather than rolling your own. For example, the utils::bibentry function is quite a bit like BibTeX. > > Duncan Murdoch > > ______________________________________________ > R-help at r-project.org <mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help <https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html <http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code.-- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Orcid ID: 0000-0002-7490-0066 Department of Evolutionary Biology and Environmental Studies University of Z?rich Office Y34-J-74 Winterthurerstrasse 190 8075 Z?rich Switzerland Office: +41 (0)44 635 47 64 Cell: +41 (0)78 630 66 57 email: Rainer.Krug at uzh.ch Rainer at krugs.de Skype: RMkrug PGP: 0x0F52F982 [[alternative HTML version deleted]]
Dear John If you are doing a systematic review have you thought of investigating some of the packages in the CRAN Task View on MetaAnalysis like metagear or revtools? I have not used any of them but they claim to support that part of the process. Michael On 04/11/2020 09:22, John wrote:> Hi, > > I 'd like to create a table for literature review. Is there any good > data structure (database) I may use? Now I just use a simple dataframe as > follows, but in the second item I swap the order of year and author, and it > records 2013 as author and "XH" as year. Is there any better structure ? > If not, how may I fix the current condition?Thanks! > > > df <- data.frame(author = NA, year = NA, title = NA, country = NA, sample > NA, data = NA, result = NA, note = NA, stringsAsFactors=FALSE) > df[1, ]<-c( > author = "Moore", > year = 2020, > title = "Statistics and data analysis", > country = "Colombia", > sample = NA, > data = "firm level", > result = NA, > note = NA) > > df[nrow(df)+1,]<- c(year = 2013, > author = "XH", > title = NA, > country = NA, > sample = NA, > data = NA, > result = NA, > note = NA) > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Michael http://www.dewey.myzen.co.uk/home.html
You might also want to take a look at this survey: https://ropensci.org/technotes/2020/05/07/rmd-citations/> On Nov 4, 2020, at 9:22 AM, John <miaojpm at gmail.com> wrote: > > Hi, > > I 'd like to create a table for literature review. Is there any good > data structure (database) I may use? Now I just use a simple dataframe as > follows, but in the second item I swap the order of year and author, and it > records 2013 as author and "XH" as year. Is there any better structure ? > If not, how may I fix the current condition?Thanks! > > > df <- data.frame(author = NA, year = NA, title = NA, country = NA, sample > NA, data = NA, result = NA, note = NA, stringsAsFactors=FALSE) > df[1, ]<-c( > author = "Moore", > year = 2020, > title = "Statistics and data analysis", > country = "Colombia", > sample = NA, > data = "firm level", > result = NA, > note = NA) > > df[nrow(df)+1,]<- c(year = 2013, > author = "XH", > title = NA, > country = NA, > sample = NA, > data = NA, > result = NA, > note = NA) > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.