gistlib
other r categories
r code snippets in r
a code in r to replace asingle "\" in a string, with a single "/" in r
a function to unload all loaded libraries in r
access excel sheet in file in r
access gpt-3 with r in r
add 90 days to a date using lubridate in r
add a column with the same value in r
add a missing variable which is present as a column but not as a row, create this row as a row of zeros in a matrix in r
add a value to a vector in r
add a variable as a row of zeros that is not present as a column in a matrix in r
add an element to the beginning of an array in r
add an element to the end of an array in r
add legend in r
add together two matricies of different dimensions in r
adf_test <- ur.df(data$abc_industries_total_sales, type = "trend", lags = 0) why is lag=0 in r
after differencing variables, how do i do arima in r
anova with repeated measure in r
append to a csv file in r
append to a file in r
assign identical list to vector of names r in r
assign specific columns of data for histogram in r
bind matching rows of two dataframes and keep unmatching columns in r
build a chaotic markow chain model to forecast univariate time series data. in r
build a simple neural network in r
build an xgboost model in r
calculate 99 percentile in r
calculate harmonic mean in r
calculate index in r
calculate out-of-sample root mean squared error for list of arima models on r in r
calculate overlap date in r
calculate rmse for a list of var models var_models on r in r
calculate rmse for a list of var models var_models on r and print in r
calculate the mean by group in r
calculate the mean by group with missing data in r
calculate the mean with a data.table in r
calculate the z score in r
calculate the z score by group in r
catch error reading file and report filename in r
change a cell value in a matrix using row and column name in r
change decimal points in r
change one value in dplyr in r
change single cell in a matrix by index number in r
change the font size of a plot made with eulerr in r
change the order of columns in r
change the orientation of x axis labels to vertical in ggplotw in r
check if column values have 90 percent overlap in vlaues in r
check last three characters of a file in r
check the stationarity of the time series data, especially for 'abc industries' sales data. you can use statistical tests like the augmented dickey-fuller (adf) test to check for unit roots. in r
clear data from environment in r
clear enviroment in r
clearing enviroment in r
cointegration using engle_granger_test in r
cointegration using engle_granger_test y variable is differenced_real_sales_ts and x variables are real_industrial_production_ts, real_interest_rate_ts and cpi_ts in r
color set in r in r
combins two datasets in r
concatenate two characters in a print() in r
confidence interval in r
convert a 10 digits character number into a 10 digit numeric number in r
convert a character number into numeric with 10 digits in r
convert a dataset into wide format but keep the names_from column as numeric in r
convert a tibble to an xts using the `date` column of the tibble as the xts index in r
convert an existing matrix to all zeros in r
convert character matrix to numeric in r
convert columns into rows in r
convert from posix time in r
convert from scientific notation to regular notation in r
convert geometry from a .shp file into a new df with id and x and y coordinates in r
convert geometry from a .shp file into a new df with the id column from the .shp file and x and y coordinates in r in r
convolve array in r
copy a csv file in r
copy a directory in r
copy a file in r
copy rownames to new column in a matrix in r
correlation matrix with certain variables in r
count number of instances that one column has a zero and matching row has a non-zero value in r
count the number in a grouop in r
count the number of duplicate rows per value in a specific column in r
covnert a dataframe variable from character to factor in r
create a 2 paired t test on two random datasets of numbers in r
create a bar graph by counting the elements in an array in r in r
create a bar graph out of the elements in an array in r
create a boxplot in r
create a boxplot of a chosen variable in the data frame called plantgrowth in r
create a boxplot with ggplot2 in r
create a boxplot with pink lines in r
create a community matrix and use its laplacian matrix to get eigenvectors sorted by their corresponding eigenvalue in non-decreasing order. then use k means algorithm and plot a cluster graph in r
create a community matrix and use k means to do a cluster analysis and then create a table of the cluster assignments per variable in r
create a community matrix, then find its laplacian matrix and then normalize the laplacian matrix in r
create a community matrix, then make a cluster graph based on eigenvalues and eigenvectors in r
create a csv file in r
create a dataframe in r
create a dataframe from csv file in r
create a dataframe with year from 2015 until 2023 in r
create a dataset with 2 sets of coordinates in latitude and longitude in 4 columns. then using st_as_sf convert these into 2 geometry columns in r
create a dataset with 2 sets of coordinates in latitude and longitude in 4 columns. then using st_as_sf convert these into 2 different geometry columns in r
create a dataset with 2 sets of coordinates in latitude and longitude in 4 columns. then using st_as_sf convert these into 2 different geometry columns, and then join them together in r
create a dataset with multiple dates as columns. then reorder them in sequence in r
create a directory in r
create a function for central theroem limit in r
create a function which sends an xmpp message of user input in r
create a function with mutate in r
create a knn model in r
create a leaflet map of the uk in r
create a linear regression in r
create a logistic regression on four parameters in r
create a logistic regression on four parameters and predict for each in r
create a loop in r
create a loop and make a shapiro test on specific columns chosen in a vector in r
create a loop based on columns varaibles in r
create a loop in bash in r
create a loop in specific columns from a dataframe in r
create a loop that appends a random integer 1:10 to the end of an array in r
create a loop that brings in matricies from csv files and adds them all together in r
create a loop tidyverse in r
create a loop to bring in a matrix csv file convert it to a numeric matrix and then add the matrices together in r
create a loop to get matrices convert them to numeric and then add them together in r
create a loop when 1 is added at each iteration to a numerical variable in r
create a map in r
create a map of the uk in r
create a memoised function to add two numbers in r
create a new column and use an ifelse statment to indicate by a word when another column has specific character values in r
create a new column from a dataframe that returns the minimum number in another column and ignores na in r
create a new column from a dataframe that returns the minimum number in one specific column and ignores na in r in r
create a point plot with 3 groups and a gam fit using ggplot2 in r
create a regression discontinuity model in r
create a script that will parse a file every day and add new lines to a database in r
create a shiny app in r
create a side-by-side bar plot in r in r
create a stacked bar with the geom_bar() of the "carrier" variable in nycflights in r
create a table that counts the number of times each integer from 1 to 100 appears in an array in r
create a table that counts the number of times each integer from 1 to 100 appears in an array, a row for every integer from 1 to 100 in r
create eigenvalues and eigenvectors from laplacian matrix then plot to cluster plot in r
create function to print numbers 1 to 10 in r
create shiny app for cv in r
create sub dataframe according to columns values in r
create transaction network diagram in r
create two dataframes and then join them by column variable in r
create two dataframes and then join them by column variable in r and introduce nas when they don't match in r
create two histograms in r
create two points using latitude and longitutde coordinates then using st_cast draw a line connecting the two in r
create two sets of points using latitude and longitutde coordinates then using st_cast draw a line connecting each set of two points in r in r
creates timeseries in r
creating data frame from large data pool in r
data analysis in r
dataset with subset of variables in r
decompose a time series using the stl model and plot the decokmposition plot using autoplot in r
delete a csv file in r
delete a directory in r
delete a file in r
delete a row and column from matrix by name in r
delete a variable in r
delete empty rows in r
detect independence in r
dgtmatrix .mtx_cols in r
diebold mariano test on r in r
diebold mariano test on r using 2 models in r
discision tree in r
display a range from 1 to 10 in r
display all column of a df in r
display all unique values from a variable in r
divide alternating rows in table in r
divide row by another row if it is a certain comun in r
divide value in a tabble based on side column in r
dm test on r in r
do a variation partioning in r
do a variation partioning using vegan package in r
do something 1000 times in r
dplyr filter multiple columns for unique value in r
dplyr left join without middle names in r
dplyr remove prefix column names in r
dplyr rename first character all column names in r
dplyr rename prefix column names in r
draw plot in r
draw x-y plot in r where the size of the scatter is by size of column z in r
draw x-y plot using the ggplot package where the size of the scatter is by size of column z in r in r
drop variables in r
drying kinetics and moisture diffusivity in r
duplicate every row in a table and add a suffix in r
duplicate every row in a table and add a suffix with dplyr in r
dynamic diff-in-diff in r
estimate and test for a set of possible models. since you have mentioned that interest rates, inflation, and industrial production growth may be potential predictive variables in r
example for fitdistr() in r
example for sink() function in r
export a dataframe as csv file in r
export csv in dataframe in r
export csv in dataframe, remove specific rows and column in r
export df as csv in r
export list as csv in r
exporting created csv in r
extract characters 4,5,6,7 out of a string of 10 characters in one column and place them in another column in r
extract dataframe from list in r
extract significant variables in r
extract the latest entry of a file in r
filter a data.table in r
filter a dataframe based on two values from a column in r
filter a dataframe by columns name pirate and actor in r
filter a dataframe from a specific value in a column in r
filter a dataframe from specific variable value superior to in r
filter a dataframe rows based on multiple values from a specific column in r
filter dates tidyverse in r
filter nycflights13 by month in r
filter nycflights13 by month of july in r
filtering multiple rows in one column in r
find a file using a pattern in a list of directories in r
find a zscore in r
find a zscore using sigma mean and sample size in r
find all string objects in r
find common values between vectors in r
find files containing report in their names in r
find kth most common elements in tidyverse in r
find missing values in r
find na value in summary in r
find na values in r
find patterns in a file within quotes in r
find smallest number by group in r
find the average of all elements in an array in r
find the closest 10 neighbors of a time series in r
find the contents of a directory in r
find the creation date of a csv file in r
find the creation date of a directory in r
find the creation date of a file in r
find the extension of a csv file in r
find the extension of a file in r
find the first element in an array in r
find the index of an element in an array in r
find the kth largest element in an array in r
find the kth least common element in an array in r
find the kth least frequent element in an array in r
find the kth most common element in an array in r
find the kth most frequent element in an array in r
find the kth smallest element in an array in r
find the largest element in an array in r
find the last accessed date of a csv file in r
find the last accessed date of a directory in r
find the last accessed date of a file in r
find the last element in an array in r
find the last modified date of a csv file in r
find the last modified date of a directory in r
find the last modified date of a file in r
find the length of an array in r
find the maximum number in a list of numbers in r
find the median of all elements in an array in r
find the mode of all elements in an array in r
find the name of a csv file in r
find the name of a directory in r
find the name of a file in r
find the parent directory of a directory in r
find the parent directory of a file in r
find the path of a csv file in r
find the path of a directory in r
find the path of a file in r
find the range of all elements in an array in r
find the root directory of a directory in r
find the root directory of a file in r
find the size of a csv file in r
find the size of a file in r
find the smallest element in an array in r
find the standard deviation of all elements in an array in r
find the sum of all elements in an array in r
find the variance of all elements in an array in r
fit a fixed effect model in r
fit a function to data in r
fit a glm model in r
fit a multvariate-t mixture model in r
fixed effects in r in r
for loop in r
for monthly time series dataset what should my adf test type be in r if i dont know whether my data is stationary or not in r
format date as year in r
format variable as year in r
fourier transform in r
from character to numeric in r
from character to year in r
generate synthetic dataset with rose in r
generate the nth fibonacci number in r
get 95 percentile outliers in column in r
get a list of dates for the next 20 fridays in r
get candidate join columns in r
get data from internet in r
get outliers in array in r
get respomse in r
get the first day of a week as a date in r
get the first element of the first list in a list of 48 lists. in r
get the partial derivative of x in r
get two time series. split them into intersecting windows of length 10. then find the closest 5 neighbors for one time series from the other time series in r
ggplot line plot of this "egarch.forecast$`1973-04-01 01:00:00`" in r
given a set of time series data find the slope in r
graph panel data by group in r
graph percentage in r
graph to visualize coxfit mdoel to the data in r
group by then summarize in r
growth curve model for binary outcome in r
hide user input in r
how bootstrap in r in r
how do i change a s4 into a data frame in r
how do i divide table collumns in r
how do i find the average of one variable in a datset in r
how do i find the row number of with the largest value in a colume in data.table in r
how to apply a function to a specific set of variable from a dataframe in r
how to assign a value in r in r
how to assign a variable in r in r
how to calculate rmse for models in a list in r in r
how to calculate the rmse for models in r
how to code a binomial distribution? in r
how to combine two dataframe in r
how to compute weighted average in r in r
how to connect tweeter in r in r
how to create a data table in r
how to create a dataframe in r
how to create a def in r
how to create a loop for principle component analysis in r
how to create a package in r in r
how to create a scatterplot in r
how to create a shapiro test to a specific set of columns from a table in r
how to create a table in r
how to create a token in r in r
how to create an excel in r
how to create obustbase in r
how to do bootstrap to get variances in r
how to do expectation-maximization in r in r
how to do iplot in r
how to do varx in r
how to extract p value for adf test in r
how to filter a correlation matrix in r
how to forecast a list of arima models with different regressors on r in r
how to get 10th item from 2nd column in r
how to get a vector's walsh mean in r
how to get hodges lehmann statistics in r in r
how to import data in r
how to install a package in r
how to install a package in in r
how to install an archived package in r
how to make a discision tree in r
how to make a peanut butter sandwich in r
how to make a sankey in r
how to make a shapiro test on some columns from a data table in r
how to make all arguments of a function named in r
how to make consecutive dates in r
how to merge data in r
how to moving average in r
how to name all arguments of a function in r in r
how to perform t-test in r
how to predict() in r
how to process mining in r
how to put two variables boxplot on a same categorical variable in ggplot in r
how to remove duplication in r
how to rollmean in r
how to run a two-way anova in r in r
how to separate a datestamp into month and day in r in r
how to use factor in in r
how to use predict() in r in r
i want to check the stationarity of a time series data using adf. what lag to use for monthly data? in r
i want to check the stationarity of a time series data using adf. what lag to use? in r
i want to use a package installed on my pc in r
if a variable is superior to a value, add it to a vector in r
if a variable superior to a value, print something in r
import an api from a third party into a dataframe in r
import nycflights13 library in r
in a dataframe where the concentration column goes 10, 5, 2, 1 repeatedly, reverse the order of the concentration column in r
in a single ggplot2 plot plot three vectors of data of different legnht in differenct colors in r
in a time series dataframe named "csmib", drop all the rows containing na observations in r
in data.table, assign multiple columns by reference in r
in the ggplot2 plot of time series, generate vertical red lines at each date indicated in the "date" column of another dataframe in r
index rows based on values from one column in r
insert custom row and column into existing matrix in r
insert custom row and new row name in a existing matrix in r
isolate most common in r
item in r
join two dataframe and match by a common column in r
join two dataframes but match on two columns in r
join two datasets with lat and lon using a geo_left_join but only take the match with the minimum distance in r
join without middle name in r
legend in 2 columns in r
load a spreadsheet into r. combined the first four rows and six columns into a matrix and if there are duplicate values in the matrix, randomise all rows in r
load an excel file in r
load an excel file starting at row 5 in r
load the dplyr and palmerpenguis. create ggplot with body mass and filpper length, use species for color in r
log returns (continuous compund returns) of a time series in r
logistic regression in r
loop from 10 to 5 in r
loop through all files in a folder in r
loop through all items in vector test and double them in r
maak een dataframe met jaar van 2015 tot 2023 in r
make a column of numbers negative in r in r
make a dataset different sets of coordinates in 4 different columns, then in longitude and latitude format, then using st_as_sf convert these into 2 geometry columns in r in r
make a dataset of 2 sets of coordinates in longitude and latitude format, then using st_as_sf convert these into 2 geometry columns in r
make a dataset of 2 sets of coordinates, then using st_as_sf convert these to 2 geometry columns in r
make a dataset of 4 sets of coordinates in longitude and latitude format, then using st_as_sf convert these into 2 geometry columns in r in r
make a ggplot bar figure with 2 categorical variables and date on the x axis in r
make a long list in r
make a nested list in r
make a piecewisesem model in r
make a plot using geom_sf and a dataset of linestrings in r
make a pretty histogram with ggplot2 in r
make a scatterplot with two categorical variables and the alpha amount relating to weight of the value in r
make apretty histogram in r
make posth-hoc test with repeated measure design in r
make vector going from 0 to 300 in increments of 10 in r
matrix, how tu use in r
memoise a function in r
memoise fibonacci in r
moderation model orthogonalizing in lavaan in r
monterey carlo model coin flips in r
move a column in r
move a csv file in r
move a directory in r
move a file in r
mse from mean in r
multi variable look up table in r
multinomial mixed model in r
multiply matrices in r
multivariable merge table in r
mutate a column via its name in r
my monthly time series dataset starts from may-1978 to dec-2019. how many lags to use for adf test in r
named arguments in functions r in r
normalize a laplacian matrix in r
obtain modified response values with the variation removed from conditioned variable in a partial redundancy analysis in r
open file in r
open file for enviroment in r
order a dataframe by a column that matches a vector in r
parse a json file with jsonlite in r
parse list of variables to lm in r
parse variables to lm in r
perform a mediation in r
perform a repeated anova in r
perform a segmented regression in r
perform sequence analysis in r
perform sequence pattern recognition in r
pivot a dataset in r
pivot longer one column in data frame in r
plot a 3d via plotly in r
plot a distribution in r
plot a graph of g against income with three colours for each race. in r
plot a histogram with ggplot in r
plot a normal distribution with a mean of 10 and sd of 2 in r
plot barchart in ggplot in r
plot histogram with ggplot with two independent variables in r
plot three different time series of different lenghts in a single ggplot2 plot. in r
plot two dgr_graphs side by side in r
plot two graphs side by side using diagrammer in r
plot when years are columns in r
post request gistlib query in r
predict with linear regression in r
print blank in r
r divide a row by another row if the next column matches in r
r matrix in r
randomly select an odd-index element of an array and remove it in r
read a file in r
read all files in a directory into a data frame, with a column recording filename in r
read all files in a directory into a data frame, with a column recording filename using tidyverse in r
read in a csv file in r
read through a loop of csv files and record which files has the maximum number of variables in r
read through a loop of csv files and return which ones have 30 variables in r
recode some rows of dataframe in r
regex after underscore in r
regex all numbers in r
regex number in r
regex return string after the last underscore in r
regex return string after underscore in r
regex second number in r
remove mutltiple columns from a df in r
remove a column in a df which contamin special characters in r
remove a column in a df with a special name in r
remove a row from a dataframe in r
remove all punctuation from character in r
remove an element from an array at a specific index in r
remove an element from the beginning of an array in r
remove an element from the end of an array in r
remove an element from the middle of an array in r
remove column 'a' and 'c' from a df in r
remove columns in a dataframe in r
remove columns in a df based on a pattern inside the columns names in r
remove dataset in environment in r
remove rownames in a matrix in r
remove specific columns in a dataframe in r
remove text after character in r
remove the variation in response variable coming from the variation in explanatory variables in r
remove values from environment in r
removing column from a df with their column names in r
removing column from a df with their names in r
rename a csv file in r
rename a directory in r
rename a file in r
reorder columns in r
reorder multiple data columns so oldest is on the left and newest is on the right in r
retrieve response table from conditioned redundancy analysis in r
retrieve response variable values from reduced variation by conditioned redundancy analysis in r
return the row containing a specific value of two different columns in r
reverse a vector in r in r
reverse an array in r
reverse the order of a column of a tibble using tidyverese in r
rmse in r in r
rotate x axis title to 90 degress in ggplot in r
run a difference in differences analysis in r
run a logistic regression in r
run principal component analysis in r
scrape gistlib query in r
scrape website chemdraw for low melting point in r
search fastq for 2 oliglionuclitides in r
select a column in data frame in r
select all the col in df exept the last in r
select all the ol in a df exept the last 2 in r
select columns from a df in r
select data in r
sequence dates lubridate in r
set a new path in r
set the first row as headers in r
solve the travelling salesman problem in r
sort a dataframe according to a specfic variable pattern in r
sort an array in r
sort date columns in wide format in r
sort df by one character column in r
sort one column of characters by the order of another column in another dataframe in r
sort row order as the column order in a matrix in r
sort rows with missing values in r
split a time series data to windows of length 10. then for each window, find the closest 5 neighbors from past in r
split a time series data to windows of length 10. then for each window, find the closest 5 preceding neighbors using weighted euclidean distance in r
spread a data frame in a list in r
standardize data in r
start a process in r
style a histogram with ggplot in r
subset a list using time in r
subset a part of a large list of files by using the numbers in the filenames in r
subset a part of a list of files by using names in r in r
subset of variable whose names contain pattern in r
subset of variables that have pattern in r
subset using loop in r in r
summarize all variables in r
summarize all variables by group in r
summarize list of variables by group in r
summarize multiple variables by group in r
summarize variables by group in r
suppose that the price of sugar this month is 20 cents per pound. what price per pound does the ar(1) model forecast for sugar for next month? in r
take 4 characters out a string of one column and put them in another column in r
take a list and find the maximum element in every 10 element window in r
take the middle 4 characters of a string in one column and place them in another in r
takes data with two fixed effects and one random effect. makes a mixed effects model in r
test difference of variances of 2 variablse in r
test if a json file is corrupt in r
test if a segmented model with two breakpoints describes the data better than a segmented model with one breakpoint in r
tidyverse overlap 90 percent column values in r
to this tibble `csmib_lag1` add the column `date` from this tibble `csmib` as a date index, hence it should be the first column of `csmib_lag1` in r
train a logistic regression model in r
transform a df in dt in r
transpose a dataframe in r
transpose a dataframe according to a specific column in r
turn a graph to a png in r
turn a list into a table in r
unnest a list in r
upload .mtx_cols in r
use a community matrix do spectral analysis using k means, and plot a cluster graph with ordered centers in r
use eigenvectors and values to plot a cluster plot in r
use index number to name file in r
use index number to name file in a loop in r
use linear interpolation to get missing datapoints in r
use pivot_wider to change only some columns to wide format and keep others in long format in r
use pivot_wider to change two columns with values to wide format and keep others in long format in r in r
use pivot_wider to convert dataset to wide, and sort date columns from left to right in r
use the ave function in r
using filter in r
using lavaan structural regression, with agency as auxiliary covariate in r
using mutate_at convert from scientific notation to regular notation in r in r
v-dem data in r
variable name that contains a pattern in r
varx forecasting in r
vote results percentage graph in r
what does "\\3" mean in r
what is family in r
what is the difference between <- and = in r
what is the number variable in the "email" data frame? in r
when a column does not exists as a row in a matrix, add a new one as a row of zeros in r
when column variables do not match row variables in a matrix, add the missing variable as a row of zeros in r
when column variables do not match row variables in a matrix, add the missing variable as a row of zeros in r and/or a column of zeros in r
when i am doing the engle granger test do i have to make sure all the variables are non stationary or just the x variables are non stationary in r
when patterns match in cells between two columns replace the second column with the value in the first in r
when patterns of numbers match in two columns replace the second column with the value in the first in r
when row value matches in 2 columns of data, replace the value in the second column with the value in the first column in r
when rownames do not match all columnnames in a matrix, find the missing variable and add it as a new column of zeros in r
when rownames don't match columnnames of a matrix, add these as a column of zeros. in r
write a code for selecting only the rows which contain a specific word in one of the coulmns in r
write a code in r that add to every single backslash in string, another one in r
write a code that takes a community matrix and does spectral analysis using laplacian matrix and plots a cluster graph in r
write a code to identify states in timeseries data with hmm in r
write a function for nested block design anova in r
write a function for nested random factor anova in r
write a function that accepts a path to a r script and returns the paths declared there in r
write a function to subset a data.table, then wight unit test for that function in r
write a function to suggest a data.table in r
write a json in r
write a loop that extracts the number from a filename and applies it to a new list in r
write a loop which extracts the last character from a list of files and applies that number to a new list in r
write a subset sum function using dynamic programming in r
write me how to keep all the column from a df containing the word "blank" in r
write to a csv file in r
write to a file in r
z score by group in r
z score by group tidyverse in r
gistlib
by LogSnag