How can I italicize donut labels on a piedonut chart?
What I need is to place the "donut" labels with reference to the "Epecie" variable in italics. I have tried several methods without good results.This is my code:require(ggplot2) require(moonBook)...
View ArticleGgplot() in R - Rescaling Primary and Secondary Axes
I have some code that will draw a nice "combo" graph with separate primary and secondary axes (which is what I need for a particular application). A simple example here:library(tidyverse) df <-...
View ArticleReplace missed values with NA [duplicate]
I have a dataset but some of the values has ? rather than a valid value.I would like to replace the ? with real NA so I can omit them easily omit them withna.rm = TRUE to do this I used openrefine,...
View ArticleR Session on Linux - submit multiple batch jobs pointing to same session
1) Is it possible to start R sessions on Linux (e.g. Rsession1) and submit multiple jobs in batch mode to the same R Session (e.g. job1 to Rsession1 and then later on based on user action submit job2...
View ArticleError when mutating a dataframe in R to add a column with an if condition
I am trying to mutate the following dataframe to add a column at the end which categories each row with "Period_1""Period_2" or "Other" depending on the date. I've reproduced my code below# create the...
View ArticleWhat is the smoothing method used in type "contour" with plotly in R?
I am making a contour plot in R using plotly. I want to know what smoothing method is used (is it loess or something different?) All the documentation I could find was that:You can set smoothing as a...
View ArticleFind if at least one element of a group matches at least one pattern
I have a vector of several regexes. They are so short and so different that it is not worth trying to make a single regex that captures all of them at once.I also have a data table with two columns,...
View ArticleIs there a way to assign a value to data.table columns selected...
I'm working on a data table with roughly 500 columns and several thousands of rows, with each column representing an item that may or may not appear in a string. For example, my data looks something...
View ArticleGLM split data between train and test 70 30 respectively
split data in R train_data has rows of 891 test_data has rows of 418 i would like to split data 70% for train_data and 30% for test_data to get glm model This is how I am doing split_testD <-...
View ArticleHow to merge two lists based on object indices?
I want to merge to lists, that don't have positions with overlapping elements:mylist<-list(1,3,2) otherlist<-list(NULL,NULL,NULL,4,5,6) # Desired list(1,3,2,4,5,6) # my try:...
View Articleggplot - Labeling each line at the end using an arrow
The question probably sounds confusing, so here are a couple of pictures to illustrate what I am trying to achieve.Currently, I have this: What I want: I somewhat know about the directlabels package...
View ArticleR rename columns in many CSVs
I have 200 csvs with the same two columns (date and level). However, the columns don't currently have names. They all need to have the same column names for a package I'm using in R. Is there a way to...
View ArticlePlotly R: setting the spacing between axis label and axis ticks labels
Is there any way to set a spacing between axis labels and axis ticks labels other than changing margins?Example plot:plot_ly(mtcars, x = ~ wt, y = ~ paste0(hp, '0000')) As in the example plot above the...
View ArticleHow can i use a mixed model for my situation?
I currently have some data but am unsure how I can model it using a mixed model. My data/variables are as follows:Test(factor) - A collection of 10 tests that every person has takenValue - The scores...
View Article3-way interaction between continuous variables and data
I want to plot a 3-way interaction between continuous variables and show the data.I get three panels side by side and the marginal means for each group factor (tiv).I now want to adding the data points...
View ArticleHow to combine several ppp object
I'm not sure if it's a meaningful question but I don't understand how (and if) is it possible to combine a list of ppp objects into a unique ppp object. For examplelibrary(spatstat) #> Loading...
View ArticleHow do you find the number of unique values that span multiple columns?
How do you find the number of unique values when they span multiple columns. In my case, I am trying to get a count of the number of times each latitude/longitude occurs. For example+------------+ |...
View ArticleIterate import of excel files and averaging matched values by file name in R
I have a folder containing 630 excel files, all with similar file names. Each file represents climate data in specific geographic areas for a month of a specific year. My goal is to find a way to...
View ArticleGroup_by a unique value and find duration, while satisfying multiple...
I have a dataset, sample:Ultimately I would like to be able to group the data into 'chunks' where the Subject column contains a unique value and where the Folder column shows 'Outdata', and where the...
View ArticleR: Change color igraph based on condition if element in list of elements
I have an iGraph object. I want to change the color of certain subnodes to lightblue, while all others are orange. The following code is returning false for all nodes, thus all nodes are returned as...
View Article