Troubleshooting: Data importing, database IDs, and Plotly tables

#### Issue 1####
#importing data using the “point and click” method in R studio leads to different data structures
#how to make match data structure from read.csv()?

# Input with point and click
str(WeedAbundance)

#input with read.csv() command
dat <- read.csv(“WeedAbundance.csv”)
str(dat)

#lets make it match in type
WA <- data.frame(WeedAbundance)
str(WA)

#lets make the specific row match in type
WA$Location <- as.factor(WA$Location)
str(WA)

 

#### Issue 2####

#Two different names one column.
#want to consolidate into single named variable and keep the record of the index
#so that we can still go between databases

m[‘Vendor.WSUID’] <- stringr::str_extract(m$Comment, “(?i)VENDOR #\\d+”)
m[‘VID’] <- stringr::str_extract(m$Comment, “(?i)V#\\d+”)

d <- c(“Vendor #3452345”, “V#23245234”)
lapply(d, function(i) { strsplit(i, “#”)[[1]][[2]]})

lapply(blah blah paste0(col1, col2, collapse = TRUE))

 

#### Issue 3####

#Indexing tables output from Plotly.

#This issue was addressed after our session by contributor Julia Piaskowski, who solved the error: https://cereo.wsu.edu/2017/09/21/indexing-tables-plotly-output/