-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhowtomakeurllist.R
More file actions
33 lines (23 loc) · 890 Bytes
/
Copy pathhowtomakeurllist.R
File metadata and controls
33 lines (23 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#making a list of URL's (article titles are from Excel)
library(readxl)
# load data
testurls <- read_xl("~/Desktop/Fall 2021/testurls.xlsx")
library(tidyverse)
# get rid of spaces and replace with +
testurls<-
testurls%>%
mutate(url2=str_replace_all(url2," ","+"))
# put everything into one unified url
testurls$complete <- paste(testurls$url1,testurls$url2,testurls$url3)
# cut it down to only include the column with the whole url
testurls <- testurls$complete
# make the testurls vector into a data frame
testurls<-as.data.frame(testurls)
#make sure there aren't any spaces, replace these with nothing
testurls<-
testurls%>%
mutate(testurls=str_replace_all(testurls," ",""))
# # export to a text file
write.table(testurls,"testurlsanothertry.txt",sep="\t",row.names=FALSE, col.names=FALSE,quote=FALSE)
#class(testurls)
#testurls[,colnames(testurls)=="complete"]