This file contains 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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
This experiment was created using PsychoPy2 Experiment Builder (v1.83.04), February 07, 2017, at 16:33 | |
If you publish work using this script please cite the relevant PsychoPy publications | |
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8-13. | |
Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2:10. doi: 10.3389/neuro.11.010.2008 | |
""" | |
from __future__ import division # so that 1/3=0.333 instead of 1/3=0 |
This file contains 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
devtools::install_github("erzk/fnirsr") | |
library(dygraphs) | |
library(fnirsr) | |
file_path <- system.file("extdata", "Hitachi_ETG4000_24Ch_Total.csv", package = "fnirsr") | |
ETG_header <- load_ETG4000_header(file_path) | |
rawData <- load_ETG4000_data(file_path, ETG_header) | |
# prepare the events |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# install the package | |
devtools::install_github("erzk/zooplaR") | |
# load it | |
library(zooplaR) | |
# set up the keys | |
file.edit("~/.Renviron") | |
zoopla_key <- "YOUR_KEY_GOES_HERE" | |
zoopla_key <- Sys.getenv("zoopla_key") |
This file contains 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
# geofacet - Polska | |
# Ludność w miastach w % ogółu ludności (dane roczne) | |
library(dplyr) | |
library(geofacet) | |
library(ggplot2) | |
library(readxl) | |
# dane z Banku Danych Lokalnych | |
# https://bdl.stat.gov.pl/BDL/dane/podgrup/tablica |
This file contains 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
clear all | |
clc | |
%% Version 3 update: channels and wavelengths are re-ordered such that they | |
% are in the order Homer2 software expects. | |
% User choice to remove marker at end of stimulus as this is not needed in | |
% Homer. Thanks to Ian Wiggins for your assistance with Version 3 edits. | |
% Rebecca S Dewey 29th July 2014 | |
%% Revision update: stimulus markers are now read into the "aux" variable |
This file contains 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
% Reading vector of stimulus markers and arranging this into the format | |
% required by Homer2 and storing in the variable "aux" | |
markertimes = [find(vector_onset>0) find(vector_onset<0)]; | |
markers = vector_onset(markertimes); | |
unique_markers = unique(markers); | |
aux = zeros(count, length(unique_markers)); | |
for stimuli=1:length(unique_markers) | |
if offset == 'y' || offset == 'Y' % Version 3 | |
stim_on_off = find(vector_onset==(unique_markers(stimuli))); % Version 3 | |
stim_markers = stim_on_off(1:2:length(stim_on_off)-1); % Version 3 |
This file contains 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
# install fnirsr | |
devtools::install_github("erzk/fnirsr") | |
library(dplyr) | |
library(fnirsr) | |
# file path | |
p01_path <- "/media/.../p01_fnirs_data_MES_Probe1.csv" # MES file | |
# load the header |
This file contains 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
# remove all but block borders | |
borders1 <- which(df$Mark == 1) | |
borders9 <- which(df$Mark == 9) | |
borders10 <- which(df$Mark == 10) | |
df[borders1,] <- 0 | |
df[borders9,] <- 0 | |
df[borders10,] <- 0 | |
# block borders |
This file contains 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
# define a function | |
replace_nth_ETG4000 <- function(x, mark) { | |
x <- x %>% group_by(Mark) %>% mutate(Count = row_number()) %>% data.frame() | |
double_marks <- which(x$Mark == mark & x$Count %% 2 == 0) | |
x$Mark[double_marks] <- 0 | |
x <- subset(x, select = -Count) | |
return(x) | |
} | |
# remove second occurrence of Mark 2 |