text annotations on different ggplot facets with labels from a dataframe from...
I have a nested tibble/dataframe that looks like this toy dataset (EDITED SINCE ORIGINAL POSTING):library(tibble) library(ggplot2) library(dplyr) library(tidyr) library(purrr) id <- c(1,2)...
View ArticleSplitting Data Frame based on a specific group ID(In R)
I have a data frame where I want to split by a group based on a single group and would like to split it so I can encapsulate everything from Valley 1 to Valley 2, Valley 2 to Valley 3 and so on. Time...
View ArticleProteolysis Of A Protein Sequence [closed]
Can any one help me for a R script to break the protein sequences by enzymatic action.(trypsin). If trypsin breaks protein sequences at K and R, How can i get all the peptide fragments after cutting. K...
View ArticleMerge two data frames based on range value in R
Would it be possible to have a function that would consider having a range in the "by" argument of a joint?Example:#Table 1 A B C D 1 a 1 10 15 2 a 11 1000 12.5 3 b 1 5 2 4 b 6 1000 1 #Table 2 A B 1 a...
View ArticleHow to extract columns from a row and save the output as a variable dplyr
I am trying to extract a specific column from a specific row on my excel sheet (df)however when I try to do so I get the message Error: ... must evaluate to column positions or names, not a list Call...
View ArticleR historical travel times from OSRM
Using R and the package osrm and the function osrmTable(.) I can get a matrix of travel times. But what if I need traveltimes for the year 2015? How can I get this?
View ArticleHow to make a table of descriptive statistics in R
This is the data I have now, and it is a dataset with students from different education levels(F1) and several variables about their academic performancedata And I want to use R to make a table of...
View Articlenls sslogis: using a dummy variable as an interaction term to compare two...
I use the following model in my code:model <- nls(y ~ SSlogis(x, Asym, xmid, scal), data = data.frame(x, y)) There is a variable (V) with two levels: V1 and V2Model 1: Fitting Y to X with a sigmoid...
View ArticleConditional merge, based an event happening between two panel observations
I have a panel dataset: panel and a dataset with a list of events: Events. For the panel dataset, an equal panelID shows that two observations belong together.panelID = c(1:50) year= c(2001:2010)...
View Articlereading data frame stored in HDF5
I have a large data-frame (126041 Obs. of 604 variables). I'm new to HDF5 formats. I save the HDF5 file as follows:writeH5DataFrame(myData,"C:/myDir/myHDF5.h5",overwrite=T)how can I read the data frame...
View ArticleFind vector of strings in list (R)
I have a list, in which each element is a vector of strings, as:l <- list(c("a", "b"), c("c", "d")) I want to find the index of the element in l that contains a specific vector of strings, as c("a",...
View ArticleIncluding a graphic in PDF with xelatex
I'm trying to include an image in a kableExtra table, but it will only be included if I remove the xelatex and setmainfont code from my markdown. Does anyone have a solution for this? I have tried with...
View ArticleWhat is the best way to validate international geographic data?
I have a dataset of ~600 observations that contains geographic data. The data are international, so it is possible for the address, city, etc. to be in the United States but also in any other country...
View ArticleHow to block randomize data according more than just 1 parameter using R
I want to do block randomize my data into 3 arms with respect to both gender and smoking status as best as possible. Here is some simulated data similar to my actual data. Note that males & females...
View Articlechange coefficient names in coefplot.glm()
I would like to plot a coefplot.glm() with costumized coefficient names.Consider the following code:coefplot::coefplot.glm(lm(rbinom(1000,1,.5) ~ rnorm(1000,50,2) + rbinom(1000,1,prob=0.63) +...
View ArticleData transformation in R: Splitting a level in two
I've got a df with country-level data entered in 2003.Several rows of data belong to a country named 'Federal Republic of Yugoslavia'. These are two separate countries today and I want to duplicate...
View Articleimport NAMESPACE and DESCRIPTION question?
When installing a package R will look at the 'Depends' and 'Imports' in the DESCRIPTION file to see which additional packages need installing.When attaching 'library()' the package to an R session then...
View ArticleHow to save multiple .jpeg image files into a directory after making changes...
I am trying to make changes to some camera-trap photos. Here is the issue: I need to remove photos from a camera-trap station from 1500-2000 hrs, which were taken due to wrong setting. I was able to...
View ArticleAdd vector to array in R
I have an array width.ndvi <- 51 height.ndvi <- 51 totalframes <- 4464 ndvi.array <- array(0, dim = c(height.ndvi, width.ndvi, totalframes)) giving [1:51, 1:51, 1:4464] as the structure of...
View ArticleProblem with calling an R package in Python
For context: My goal is to create a graphic interface so that the user can run a program that I have been developing in R. The interface is done using the Tkinter module from python (version 3.3)....
View Article