Working with Network Canvas data in R demo help

Hi all - I am brand new to Network Canvas and also brand new to doing data analysis using R, so I’ve been trying to follow the demo at this tutorial to familiarize myself with the process before attempting to apply the process to my team’s data!

However, I keep running into issues with the import step. I’ve made sure to unzip the folder with the demo data, but trying to examine the alter data file shows that it’s blank and none of the columns exist. I thought it was related to the folderPath line, but I can’t seem to properly paste in the correct folder path, or at least get R/RStudio to recognize where the unzipped files are. I’ve tried the below:

  • The line given from the tutorial: folderPath ← paste0(getwd(),‘/networkCanvasExport/’)
  • Inserting the file address from my computer: folderPath >- paste0(getwd(), ‘/C:/Users/daniell2/Downloads/networkCanvasExport/networkCanvasExport/’)
  • RStudio’s Environment window displayed that, when using the line given in the tutorial, the folder path was going to my Documents (as opposed to where the files were, in the Downloads). So I also tried moving the files into the Documents library, re-running that line, and refreshing the Environment, still nothing.

If it is of relevance, I’m using Windows and have both tried across both R and RStudio, on different Windows devices (only one of which has RStudio, the other only has R).

Any pointers, tips, or illuminating details would be greatly appreciated!

The paste0(getwd(),‘/networkCanvasExport/’) command will only works if the networkCanvasExport folder is saved in your current working directory. From your edits, I’m guessing it would just be easiest to directly specify the absolute path, which should look something like this:

folderPath <- paste0("C:/Users/daniell2/Downloads/networkCanvasExport/")

You also specified “networkCanvasExport/networkCanvasExport” at the end of the file path which seems unusual but could be the case if you unzipped the files into an already existing folder named “networkCanvasExport.” If that’s the case you’d just have to add that like here:

folderPath <- paste0("C:/Users/daniell2/Downloads/networkCanvasExport/networkCanvasExport/")

Best,
Pat

Hi Pat, you’re absolutely right that the unzipped files were placed into the existing folder named “networkCanvasExport.” Either way, I went straight to trying that last file path you gave me and it worked like a charm, thanks so much!!