library(fastrtext)
    
    data("train_sentences")
    data("test_sentences")
    texts <- tolower(train_sentences[,"text"])
    tmp_file_txt <- tempfile()
    tmp_file_model <- tempfile()
    writeLines(text = texts, con = tmp_file_txt)
    execute(commands = c("skipgram", "-input", tmp_file_txt, "-output", tmp_file_model, "-verbose", 1))
## 
Read 0M words
## Number of words:  2061
## Number of labels: 0
## 
Progress: 100.0% words/sec/thread:   26816 lr:  0.000000 loss:  2.678900 ETA:   0h 0m
    model <- load_model(tmp_file_model)
## add .bin extension to the path
## [1] "the"  "</s>" "of"   "to"   "and"
  # print vector
  print(get_word_vectors(model, c("time", "timing")))
##              [,1]        [,2]        [,3]       [,4]      [,5]       [,6]
## time   0.02959502  0.06010867 -0.05400107 0.05320135 0.1476965 0.03841716
## timing 0.05618547 -0.01243581 -0.11417959 0.10124821 0.1271733 0.04243732
##              [,7]        [,8]        [,9]      [,10]       [,11]
## time   0.07363261 -0.04418144 -0.02526939 -0.2263586 -0.09980065
## timing 0.09551279 -0.03906059  0.02052113 -0.2699087 -0.14082828
##              [,12]       [,13]       [,14]     [,15]     [,16]       [,17]
## time   -0.08723335 -0.11608054 -0.08150512 0.1411443 0.2313867 -0.01891557
## timing -0.06943166 -0.05823236 -0.07322624 0.1783224 0.1902535  0.06749269
##             [,18]      [,19]     [,20]      [,21]      [,22]      [,23]
## time   -0.2356938 -0.1998220 0.1384276 -0.2716082 -0.1160527 0.11834339
## timing -0.2151377 -0.2440516 0.1364473 -0.3001859 -0.1321048 0.09948532
##            [,24]       [,25]      [,26]     [,27]      [,28]     [,29]
## time   0.1515016 -0.10647876 -0.1118322 0.3263906 -0.1740864 0.1523127
## timing 0.1727627 -0.05365174 -0.1270310 0.3277457 -0.1976750 0.1399208
##              [,30]      [,31]       [,32]      [,33]     [,34]       [,35]
## time   -0.01314780 -0.2066007  0.03560545 -0.3695726 0.2229003  0.03206625
## timing  0.03101247 -0.2091247 -0.01076312 -0.4337085 0.2950477 -0.04411519
##              [,36]      [,37]      [,38]         [,39]      [,40]
## time   -0.10924987 -0.2769971 -0.1239068 -0.0759411976 -0.2227520
## timing -0.06980934 -0.2874494 -0.1228085 -0.0008124309 -0.2430726
##             [,41]     [,42]     [,43]     [,44]      [,45]      [,46]
## time   -0.1149967 0.2400333 0.3616800 0.1092856 -0.2411731 -0.3590198
## timing -0.1387255 0.3292241 0.3135343 0.0985520 -0.2670776 -0.3171898
##              [,47]     [,48]      [,49]      [,50]       [,51]       [,52]
## time   -0.02938056 0.1515682 -0.1051272 0.07235600 -0.06172694 -0.08029503
## timing -0.04540055 0.1061521 -0.1530714 0.07120365 -0.05589727 -0.03887039
##            [,53]      [,54]      [,55]      [,56]       [,57]      [,58]
## time   0.2236839 0.04611988 -0.1911403 -0.1866221 -0.07460221 -0.3680827
## timing 0.2932981 0.02291241 -0.2145294 -0.1554476 -0.06241326 -0.3201556
##             [,59]     [,60]      [,61]      [,62]       [,63]     [,64]
## time   0.06739996 0.2021686 -0.1183848 -0.1334427 -0.01189781 0.3566489
## timing 0.04585862 0.2045726 -0.1335259 -0.1546530 -0.01631194 0.2907756
##              [,65]      [,66]      [,67]      [,68]       [,69]
## time    0.01208309 -0.3017991 0.04112714 -0.2423630 -0.08612706
## timing -0.01554724 -0.2923151 0.04016153 -0.2037382 -0.09622924
##              [,70]       [,71]     [,72]       [,73]      [,74]
## time   -0.02057980 -0.02671514 0.1433837 -0.04638087 -0.1923294
## timing -0.05587794 -0.02928121 0.1302894 -0.05529684 -0.1968225
##              [,75]       [,76]       [,77]     [,78]      [,79]     [,80]
## time   -0.01565322 -0.01312404 -0.02543834 0.2155947 -0.0443375 0.3029869
## timing -0.01594460 -0.02125236 -0.02999854 0.2064811 -0.1106273 0.2945555
##               [,81]      [,82]      [,83]      [,84]       [,85]
## time   -0.067483343 0.03961064 -0.1258472 0.03899388 -0.02037482
## timing  0.004798817 0.02027037 -0.1530486 0.01691192 -0.03008192
##              [,86]     [,87]      [,88]      [,89]      [,90]     [,91]
## time   -0.05750696 0.1680062 0.08263414 -0.2814256 0.01987933 0.2826871
## timing -0.04928998 0.1786722 0.02441137 -0.2799990 0.01411917 0.3024377
##            [,92]     [,93]       [,94]      [,95]      [,96]      [,97]
## time   0.1441790 0.1749063 -0.12116469 -0.1639173 0.06793062 -0.2355551
## timing 0.1328227 0.1493107 -0.05778781 -0.1963746 0.13798782 -0.2368912
##             [,98]       [,99]      [,100]
## time   -0.1633533 -0.11422565 -0.02692260
## timing -0.1711848 -0.09896649 -0.01124688
##            [,1]
## [1,] 0.02378275
  # free memory
  unlink(tmp_file_txt)
  unlink(tmp_file_model)
  rm(model)
  gc()
##           used (Mb) gc trigger (Mb) max used (Mb)
## Ncells  639087 34.2    1245654 66.6  1245654 66.6
## Vcells 1266907  9.7    8388608 64.0  1865276 14.3