Load Raw Data

Import csv file from my local directory or wherever

dictionary_defs <- read.csv("~/Library/CloudStorage/OneDrive-TempleUniversity/Reilly_RData/Dictionary Definitions/data/dictionary_raw.csv")

Save file as rda

Then post that rda in a public repository on Github

save(dictionary_defs, file = "data/dictionary_defs.rda")

Load data from Github public repo

Do not write the file into a new object name in the same line it is being loaded into

library(RCurl)
load(url("https://github.com/Reilly-ConceptsCognitionLab/reillylab_publicdata/blob/main/dictionary_defs.rda?raw=true"))
head(dictionary_defs)
Entry POS Def
A The first letter of the English and of many other alphabets. The capital A of the alphabets of Middle and Western Europe, as also the small letter (a), besides the forms in Italic, black letter, etc., are all descended from the old Latin A, which was borrowed from the Greek Alpha, of the same form; and this was made from the first letter (/) of the Phoenician alphabet, the equivalent of the Hebrew Aleph, and itself from the Egyptian origin. The Aleph was a consonant letter, with a guttural breath sound that was not an element of Greek articulation; and the Greeks took it to represent their vowel Alpha with the a sound, the Phoenician alphabet having no vowel symbols.
A The name of the sixth tone in the model major scale (that in C), or the first tone of the minor scale, which is named after it the scale in A minor. The second string of the violin is tuned to the A in the treble staff. – A sharp (A/) is the name of a musical tone intermediate between A and B. – A flat (A/) is the name of a tone intermediate between A and G.
A An adjective, commonly called the indefinite article, and signifying one or any, but less emphatically.
A In each; to or for each; as, “twenty leagues a day”, “a hundred pounds a year”, “a dollar a yard”, etc.
A prep. In; on; at; by.
A prep. In process of; in the act of; into; to; – used with verbal substantives in -ing which begin with a consonant. This is a shortened form of the preposition an (which was used before the vowel sound); as in a hunting, a building, a begging.

Loading files from the OSF

You want to read a data file (e.g., .rda, .csv, .xlsx) into R by downloading it directly from a public repository on the project page of the OSF. Things get weird really damn quickly. Here’s what to do.

Step 1

Start on the OSF project page for your project of interest. Click on the files tab.

Step 2

Click on the filename of interest then copy its URL

Step 3.

Copy the URL in your browser bar. That’s almost your download link.

Step 4

Add ‘/download/’ inside to the path.

LIVE ACTION FOR LOADING CSVs FROM AN OSF SITE

You can read the file in two steps – it all depends on its format (e.g., csv, rda).

# Read CSV files from OSF, read.csv doesn't work that well with HTTPS, so use
# readr for CSV files

# using readr (tidyverse)
library(readr)
data <- read_csv("https://osf.io/download/3fmch/")
str(data)
## spc_tbl_ [1,340 × 5] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ id        : num [1:1340] 1 2 3 4 5 6 7 8 9 10 ...
##  $ word_start: num [1:1340] 0.44 0.81 1.2 1.41 1.71 2.76 3.13 3.28 3.71 4.18 ...
##  $ talker    : chr [1:1340] "FT" "FT" "FT" "FT" ...
##  $ text_raw  : chr [1:1340] "fresh" "air" "i'm" "tgross" ...
##  $ text_prep : chr [1:1340] "fresh" "air" NA "tgross" ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   id = col_double(),
##   ..   word_start = col_double(),
##   ..   talker = col_character(),
##   ..   text_raw = col_character(),
##   ..   text_prep = col_character()
##   .. )
##  - attr(*, "problems")=<externalptr>
# Load rda file from OSF, need RCurl package