gistlib
other r categories
data-manipulation code snippets in r
add a variable as a row of zeros that is not present as a column in a matrix in r
change one value in dplyr in r
count number of instances that one column has a zero and matching row has a non-zero value 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 new column and use an ifelse statment to indicate by a word when another column has specific character values in r
create a table that counts the number of times each integer from 1 to 100 appears in an array, including a row for the numbers between 1 to 100 that have 0 occurances in r
creating data frame from large data pool in r
dm test on r in r
duplicate every row in a table and add a suffix in r
index rows based on values from one column in r
insert custom row and column into existing matrix in r
make a column of numbers negative in r 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
regex all numbers in r
remove a column in a df which contamin special characters in r
reorder multiple data columns so oldest is on the left and newest is on the right in r
select all the ol in a df exept the last 2 in r
subset a part of a large list of files by using the numbers in the filenames in r
using filter 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 patterns match in cells between two columns replace the second column with the value in the first 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
write a code for selecting only the rows which contain a specific word in one of the coulmns in r
gistlib
by LogSnag