Create Phylogeny Tree (Newick File) from Distance Matrix?
I have established my gene clusters and already calculated the distances needed to measure their phylogenetic relationship. I used an algorithm basically gives a measure of distance between gene...
View ArticleHow do I stop the haven read_sav function returning upper case or lower case...
I used the haven package to import a SPSS dataset into R. Works fine for me most of the time but I'm not able to find out why the first letter of each variable is sometimes upper case and sometimes...
View ArticleAutocoding using RQDA
I try to use RQDA for quantitative text analysis. I want to code text passages with the same characters automatically. Let´s say I have the category dog and I marked "dog" in the first sentence and...
View ArticleUnlist a column of a dataframe
Having this dataframedf <- structure(list(date = c("2008-07-31", "2008-08-04"), id = c(1L, 1L), body = list("text 2 and here another", c("another text here", "and this in the same row", "one more in...
View ArticleConvert matrix with negative values into a raster
I have a matrix 'm' containing minimum temperature values. Some of these values are negative. I need to convert this matrix to raster. So when I use raster() command from package raster, I get the...
View ArticleSolving differential equation in R
I have an equation as below;dN/dt = N(t)G(t) G(t) is given by the equation: dG/dt = a * G How do I solve this in R, using ode function from deSolve package?
View ArticleAdd new variables financial dataset r
I have a question about a financial transaction dataset. The data set look as the following: Account_from Account_to Value Timestamp 1 1 2 10 1 2 1 3 15 1 3 3 4 20 1 4 2 1 10 2 5 1 3 25 2 6 2 1 15 3 7...
View Articleconverting input from shiny brushedPoints() into a dataframe
I am using interaction in shiny from this page https://shiny.rstudio.com/gallery/plot-interaction-selecting-points.html. I then copied into the clipboard the table that is generated when you "brush"...
View ArticleR package declaring author in DESCRIPTION
My DESCRIPTION file looks like this (showing only relevant part).Author: John Doe Authors@R: person("John", "Doe", email = "john.doe@email.com",role = c("aut", "cre")) Maintainer: John Doe...
View ArticleHow to choose colour for edges between an igraph object and subgraph in R
I have a citation network for a dataset of journal articles. The main igraph object looks like this:print(maingraph) IGRAPH 69c0f07 DN-- 54172 285124 -- + attr: name (v/c), label (v/c) + edges from...
View ArticleReplace negative values by zero
We want to set all values in an array zero that are negative.I tried out a a lot of stuff but did not yet achieve a working solution. I thought about a for loop with condition, however this seems not...
View ArticleR shiny crashed even after trycatch()
Below is the part of my server code. Actually there is an error in SQL for some conditions. So when I execute in R calling SQL, the R shiny crashes. So i tried putting trycatch(). Even then the app...
View ArticleHow can I add filters for both table and image in SAP Analytics Cloud?
I have a table with some values and set of images as logo for the values. I want to add filters for the table and as I select I want the corresponding logo to appear. I want to have radio buttons and...
View ArticleLoad file located in blob into R environment
I'm having some issues trying to figure-out how to do the following:At the moment, I'm downloading tabular data located in a blob container usinglibrary(arrow) endp <- storate_endpoint(endpoint =...
View ArticleHow to calculate direct and indirect standardized rates by subgroups in R?
Using below example data, I am trying to calculate direct and indirect standardized rates by subgroups such as year, region and sex using "ageadjust.indirect" and "ageadjust.direct" functions in R, but...
View ArticleHow to use R models in Python
I have been working on an algorithm trading project where I used R to fit a random forest using historical data while the real-time trading system is in Python. I have fitted a model I'd like to use in...
View ArticleFind Islands in GenomicRanges
In GenomicRanges one interesting problem is the identification of gene islands.I am trying to find the largest subset of ranges in which neighboring ranges dont exceed a certain distance. To solve the...
View Articleggsave(): Error in UseMethod("grid.draw") : no applicable method for...
I am trying to save a plot with ggsave(). I enter the following:library(ggplot2) Test = data.frame("X" = seq(1, 10, 1), "Y" = 2*seq(1, 10, 1)) P = ggplot( Test, aes(x=X, y=Y))+ geom_line() ggsave(P,...
View ArticleDate on X axis is not in date format in R visualization
I am having a problem with Date in R, in my dataset the format of my date is like this: 15.01.2018, but in my X, I see [0, 50, 100, ...] instead of date.This is my simple program to have a line chart...
View Articlewriting R function with ggplot
I have to plot multiple datasets in the same format, and after copy-pasting the code several times, I decided to write a function. I understand simple function in R, and managed to write the...
View Article