Create a point at an intersection of two circles using R
I'm trying to add a point on my plot at the intersection of two circles. Find below a sample of code. If adding a point is not possible, it could be useful to me to know the coordinates of the...
View ArticleHow to make edge colours a gradient in ggnet2 in R?
I'm trying to produce a plot using the ggnet2 package in R. I have created a network (net.bg) and I am using ggnet2 to plot it like so:p <- ggnet2(net.bg, mode = "circle", size = RImp, color = RImp,...
View ArticleDynamic add geom_segment to a diagram
I have a dataframe like thislibrary(ggplot2) df = data.frame(N = c(12, 18)) And I want to getI doggplot()+ geom_segment(aes(x = 0, y = 0.5, xend = max(df$N), yend =0.5), color="grey50",...
View ArticleMerging Data frames by common column [duplicate]
I have two dataframes and I want to merge the smaller one with one column of the bigger one (but only with the same values from a common column). How can I do it?
View ArticleHow to create an empty R vector to add new items
I want to use R in Python, as provided by the module Rpy2. I notice that R has very convenient [] operations by which you can extract the specific columns or lines. How could I achieve such a function...
View Articlei have a problem with software R with anova test for glm
Hi I would like to know the meaning of the first three columns, "Resid. Df", "Resid. Dev" and "df" and how they are calculate, on the output of anova test for glm. I put a picture of an example. Can...
View Articlehow to apply a function on a list and return a vector?R
I am trying to create a vector with the sum of the forecasts created but the vector is only storing the last value, how to create a vector with each sum?library(forecast)...
View ArticleError in mutate_impl(.data, dots) : attempt to use zero-length variable name...
I am using R Services on SQL Server. Following is an example of my code where I am computing Max of a column using R :EXECUTE sp_execute_external_script @language = N'R' , @script = N' r =...
View ArticledbReadTable coercing date column from SQL database to character
I can write a date to an SQL table with DBI::dbWriteTable() and see that the column is in fact formated as a date on the database. But when I use DBI::dbReadTable() the same date column is coerced to a...
View ArticleGraph of World map for df with country listing
I am trying to map my data on a world map according to the number of times the country has been listed.Let's say I have this datasetcompany country ... A Germany B China C Argentina D United States of...
View ArticleCreating line graph using categorical data
Trying to display "Grades" over inspection year, and the count is just the observations in the data frame. Creating a quick table:table(mydata1$Grade,mydata1$Inspection.Year) Creating a quick barchart:...
View ArticleUn-paired t-test using data within one column
I want to do an unpaired t-test to examine if values differ between sites in each type category.So my question is, within types (AB or CD), do values (valueA or valueB) differ between sites (A or...
View ArticleTrack specific fields clicked on Datatables
I have application where I am tracking all the user activity. But one major problem is there. I have a datatable in my application where when the user clicks on specific column (say " Africa"), this...
View ArticlePlotting both within and between groups differences
I am using ggpubr currently to plot my values. Thanks to the facets I managed to create subplots according to some factor. Finally, using the function stat_compare_means() I managed to plot only the...
View ArticleHow to set NA = to two different values? [duplicate]
How can I set my NA to two different things?My data set uses 0 and nd to represent missing data and I got my code to work for one value, but I cannot get it for both.I tried to separate NA = and a...
View Articlefinding out what the most profitable product in terms of money in 2016?
id product account year cost 1 crisps 100 2017 4 2 lipsticks 103 2017 3 3 chocolate_bars 107 2016 1 4 chocolate_bars 107 2016 1 5 crisps 115 2018 4 6 chocolate_bars 111 2017 1 7 lipsticks 408 2016 2 8...
View ArticleHow to count the most popular names in a column (the names are separated by...
I am trying to get the most frequent country of movie production from this netflix data set, but freq_terms in qdap package only gave me the terms: freq_terms(netflix$country) > WORD FREQ 1 united...
View ArticleIn R, use nonstandard evaluation to select specific variables from data.frames
I've got several large-ish data.frames set up like a relational database, and I'd like to make a single function to look for whatever variable I need and grab it from that particular data.frame and add...
View ArticlePlot: how to change the breaks?
I'm plotting a survival curve with the survival library, and I haven't found any way to change the breaks range.For example:library(survival) temps <-...
View ArticleInitialization of topic-word distribution in R using topicmodels package
I am estimating a topic model for different two time periods; period_1 and period_2 using the Gibbs Sampling in the R package topicmodels, with the number of topics=4; I want to use the topic-word...
View Article