This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Generates 3 GB of Swap Partition | |
| sudo /bin/dd if=/dev/zero of=/var/swapfile bs=1M count=3072 | |
| sudo /sbin/mkswap /var/swapfile | |
| sudo chmod 600 /var/swapfile | |
| sudo /sbin/swapon /var/swapfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| myList <- list() | |
| for(i in 1:10){ | |
| myList[[i]] <- data.frame(a = rnorm(100, 0,1), | |
| b = rnorm(100, 0,1)) | |
| } | |
| library(xlsx) | |
| for (i in 1:3){ | |
| write.xlsx(myList[i], | |
| file="test.xlsx", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###### MISSING VALUE IMPLEMENTATION ########## | |
| # Install this packages to System R | |
| remotes::install_github("cran/BaylorEdPsych") | |
| remotes::install_github("cran/mvnmle") | |
| install.packages("mice") | |
| # Select System R in Rj Editor's Settings | |
| # Set your working directory for saving implemented data | |
| setwd("C:/Jamovi") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #It must be run on Rj Editor module of Jamovi | |
| x.data <- data #data is the jamovi data. | |
| x.data <- na.omit(x.data) #Remove NA values | |
| x.center <- colMeans(x.data) | |
| x.cov <- cov(x.data) | |
| distance <- mahalanobis(x.data, x.center, x.cov) | |
| cutoff <- qchisq(p = 0.999 , df = ncol(x.data)) #Cutoff value. p could be changed to 0.95, 0.99 etc. | |
| x.data[distance > cutoff, ] #Show only outliers | |
| #Source: https://towardsdatascience.com/mahalonobis-distance-and-outlier-detection-in-r-cb9c37576d7d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #In Terminal: | |
| pacmd load-module module-remap-sink sink_name=mono master=$(pacmd list-sinks | grep -m 1 -oP 'name:\s<\K.*(?=>)') channels=2 channel_map=mono,mono | |
| #source: https://askubuntu.com/a/99960 | |
| amixer -D pulse set Master 100%,0% | |
| #source: https://superuser.com/a/317297 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## This code enables Cairo in Rstudio plot preview | |
| ## Source: https://github.com/rstudio/rstudio/issues/2142#issuecomment-582096257 | |
| trace(grDevices:::png, quote({ | |
| if (missing(type) && missing(antialias)) { | |
| type <- "cairo-png" | |
| antialias <- "subpixel" | |
| } | |
| }), print = FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install libcurl4-gnutls-dev libcurl4-openssl-dev libssl-dev libxml2-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| profilename=$1 | |
| if [[ -z $profilename ]] | |
| then | |
| echo "Please enter a profile name!" | |
| exit | |
| fi | |
| if [[ $profilename = "g" ]] | |
| then | |
| chromium-browser --profile-directory="Profile 1" 1>/dev/null 2>/dev/null & disown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # One can create test information functions | |
| # by entering only the item parameters | |
| # using irtplay package. | |
| library(irtplay) | |
| # Creating a dataframe for item parameters | |
| x <- data.frame(item = c("i1", "i2", "i3", "i4", "i5"), | |
| categ = 2, | |
| model = "2PLM", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #I couldn't save my text-mining outputs other format than pickle, which is not very useful for me. | |
| #I can save the output as tab file with the Python script below. | |
| #To my opinion, it's far easier than converting pickle to csv | |
| #Connect the data to a Python Script widget and enter: | |
| import Orange | |
| data = in_data | |
| data.save("C:/Py/1.tab") |
NewerOlder