lm()-function gives different results on SolusOS Linux than on Windows
I run SolusOS a Linux distro(4.0, R 3.6.1) and Windows(Windows 10, R 3.5.2).My code:library(datasets) fit2 <- lm(Sepal.Length~Sepal.Width+Species, data=iris) summary(fit2) on Windows: Estimate Std....
View ArticleSimulation of data
I want to simulate a multivariate data using the Ricker model as shown in the code. I created the function code and I want the function to populate the data in column wise (total of 15 columns) from...
View ArticleLabeling P-values Using "stat_compare_means" in R ggplot
Is there a way to add a less than ("<") sign to stat_compare_means in ggplot if the p-value is smaller or equal to 0 and has more than or equal to 4 decimal points and if the p-value is less than or...
View ArticleCreate a detector usage table with occasions for columns [closed]
I need to create a detector usage table where the rows are individual detectors and the columns are the full date range over which they all were active. Within this table a 1 indicates the detector is...
View ArticleMultiple samplings and calculating Standard deviation and standard error of...
Assuming I have the following data:df1<-rnorm(100,000, 20,5)I want to get the following samples from df1 with 50 trials each:C=( 25,50,100,200,300,400,500,600)Next, I want to plot a trend line. In...
View ArticleCan't copy 0 from cell to cell
Small issue. I'm using rhandsontable version 0.3.7, and I'm unable to copy 0 from one cell to another. Any other number or character combo I've tried I've been able to copy from cell to cell, but not a...
View ArticleHow to find overall significance for main effects in a dummy interaction...
I run a Cox Regression with two categorical variables (x1 and x2) and their interaction. I need to know the significance of the overall effect of x1, x2 and of the interaction.The overall effect of the...
View ArticleWhy doesn't my code work for plotting a box-plot and subsequent t-test?
Here is my data (df called shannon_boxplot); Samples Diversity 1 Control 3.309361 2 Control 3.664494 3 Control 3.269842 4 Disease 2.572888 5 Disease 1.530877 6 Disease 2.357401 dput(shannon_boxplot)...
View ArticleR: crosstable anaysis for NPS calculation in r
i I have a nps survey data in R, the survey raw data look like this:df <- read.table( text = "Gender Age Promoters Passives Detractors F 20 0 1 0 M 19 1 0 0 M 21 1 0 0 F 19 0 0 1 M 20 1 0 0 M 18 0 1...
View ArticleProblem whit put information in a column in R
I have 2 dataframes, one dataframe called datos_octubre with 10131000 rows and other dataframe called datos_conductoresI wanna put a new column called operador, this column will be fill by the follow...
View ArticleUsing prey presence-absence and depth when present to explain predator abundance
I have data on both predator (birds) and prey data (fish) simultaneous collected. For birds i have number of birds and for prey i have presence/absence (as factor) and then fish depth when fish are...
View ArticleCustom breaks and labels are missing on date axis
I have a scatterplot, made using ggplot, with dates on the x-axis (covering 8 weeks) and random points. I want a vertical line in the middle at a test date, and markers every 2 weeks (forward and...
View ArticleWhat's the easiest way for the multiple if-else conditions?
I have a data set something like this:df_1 <- tribble( ~A, ~B, ~C, 10, 10, NA, NA, 34, 15, 40, 23, NA, 4, 12, 18, ) Now, I just want to compare A, B, C for each row, and add a new column that shows...
View ArticleHow to customize the content of a legend of a dotplot with ggplot2
i am using this table:fruit value feature Ratio tomato 1.79614067223751 length 0.00983606557377 zucchini 3.03886853214095 size 0.034188034188034 tomato 1.64545172419968 size 0.013114754098361 potato...
View Articlehttr GET returns wrong content-type
httr 1.4.1 R version 3.6.1 (also tried with 3.5.3) Edit (adding verbose()) output.I've got a request as follows: r <- GET("https://my.cool.domain",add_headers(.headers = c('x-api-key' = 'abcdefg',...
View ArticleNested R dataframe to JSON with objects instead of arrays
I need to convert a dataframe to JSON. There are several nested dataframes as variables in the dataframe to convert to JSON. But, when converting to JSON, I need the data for Values1 described below to...
View ArticleSaving leaflet output as html
I am using RStudio to create some some leaflet images.I would like to be able to save the output as an HTML so that it can be emailed and others can view it.Below is some sample R code which was taken...
View ArticleCreating the merge tree for a weighted igraph network in R
For a graph G, with weighted edge distances d I want to create an hclust like tree object that (using cutree) tells me which nodes in the graph will be connected to each other for a given max distance...
View ArticleMediation analysis with categorical DV
I want to test for the following mediation: X (binary) -> M (continuous) -> Y (categorical)I made a linear model (X -> M) and a mlogit (M -> Y), but I don't know how to test for mediation...
View Articleabout how to create 0.999999...... (1-10^-100) in R [duplicate]
This question already has an answer here:Is floating point math broken? 31 answersI have a very simple question. In R, how can we create 0.999999......? 1-(10^-100) gives us 1. 1-10^-4 works.
View Article