ropensci / refsplitr

R package for processing, organizing, and visualizing reference records downloaded from the Web of Science.
https://docs.ropensci.org/refsplitr
Other
55 stars 6 forks source link

read_references: Publication year still not in csv but I know why #38

Closed embruna closed 6 years ago

embruna commented 6 years ago

When you run read_references the Publication Year is still blank in the csv file. I went back and it is in the dataframe, but if you do foo_references$PY you will see they are in the dataframe as "1998\n". As a result, they PY column in the csv file in the "output" folder is blank.

An easy fix, whihc I just did manually with the file I was working on. The function needs to have something like

foo_references$PY<-gsub("\n", "", foo_references$PY)  
foo_references$PY<-as.numeric(foo_references$PY)

line 1 deletes the \n, then line 2 converts the string to a numeric value and BOOM. saved in the csv.

aurielfournier commented 6 years ago

fixed! I made the change in read_references