R comparison (1) is possible only for atomic and list types
When running my R code I get the errors: Error in t == group_1_survtimes[1] :comparison (1) is possible only for atomic and list typesandError: unexpected '}' in "}"neither of which I know how to fix....
View Articler - How to convert projected CRS units from meter to international foot using...
I am updating code that uses the sf package and I am having problems with the call to sf::st_transform().In the past, I was able to change the units in the PROJ4 string to international foot using the...
View Articleggplot: Determining breaks for continuous data in geo_map() call
Hopefully this is simple:I am working on a choropleth map with ggplot. How can I pass the breaks (quantiles, jenks and such) for a continuous variable being mapped, as opposed to relying on the default...
View ArticleLeaflet map - error Don't know how to get polygon data from object of class...
I am trying to create a leaflet map with demographic data. When creating my map's polygons, I get the error above (in the title). I already searched stackoverflow for a solution, and the answer to a...
View ArticleChanging the x-scale and its breaks in a cumilative incidence plot risk table...
I have been trying to figure out how code/get a risk table to have a similar x-axis scale and same number of breaks to that of the cumulative incidence curve. I am hoping someone else figured this out...
View ArticleAdd abline to facet_zoom in ggplot2
I have a dataset that looks like thisdata <- data.frame(x = log(runif(100, min = 1, max = 10)), y = log(runif(100,min = 1, max = 10)))When I plot using the code below, I get an error (Error in...
View Articler - sf::st_transform proj4 units string to international foot
I am updating code that uses the sf R package and I am having problems with the call to sf::st_transform.In the past, I was able to change the units in the proj4 string to international foot using the...
View Articleclmm model summary does not show p-values
I run the following model in R: clmm_br<-clmm(Grado_amenaza~Life_Form + size_max_cm + leaf_length_mean + petals_length_mean + silicua_length_mean + bloom_length + categ_color+ (1|Genero) ,...
View ArticleHow to get value of X in equation, d(M)/d(x) =constant using R?
I am trying to find the optimal quantity for which I have to equate differentiation of the Total Revenue Equation with Marginal cost. I don't know how to solve for x here. Differentiation works on...
View Articlepassing additional arguments from a main function to a sub function in R
I'm making a long script to analyze some MS data by dividing it in some main functions. Each of it consist in a step in my pipeline and have some possible sub functions to execute. Most of them don't...
View ArticleHow to adjust future.global.maxSize?
Here's a useless example that shows my pointlibrary(future)a = 1:200000000object.size(a)test %<-% head(a)I get the following error:Error in getGlobalsAndPackages(expr, envir = envir, persistent...
View Articleigraph: edges are not clipped to vertices in undicrected graphs
When I change the vertex.size in igraph, the edges are not clipped to the vertices, they end a few dots/pixel next to the vertices. Example:library(igraph)set.seed(13)g <- barabasi.game(500,...
View ArticleRayshader path has offset when plotting a ggplot2 object
I am trying to plot a world map and a path between Berlin and Cancun.So far I managed to plot a world map using library rnaturalearth and convert it to a ggplot2 object which is plotted using rayshader...
View Articleconversion of dataframe into Matrix in R
I was trying to convert a dataframe into a realRatingMatrix. But for that, I'm first converting the dataframe to a matrix and a matrix to a realRatingMatrix.The dataframe df contains 475984 rows and 3...
View ArticleReading googledrive contents from R
I'm aiming to get a list of all files in a Google Drive folder, as well as the associated metadata for those files. When I use drive_ls, it returns 3 columns: {name, id, drive_resource}. drive_resource...
View ArticleEfficiently create a column that is a list of named columns in R
I need to efficiently create a new column that is a list of named column inputs. I do not know the names of the columns to input them directly, so I need to be able to specify them by using a vector. I...
View ArticleAdding manual p-values to grouped bargraph in ggplot2
I am trying to add a manual p-value to my grouped bargraph on ggplot2. I have tried the geom_sigf function suggested in previous posts (with manual coordinates) but there is no output on my graph. I...
View Articledplyr mutate rowwise max of range of columns
I can use the following to return the maximum of 2 columnsnewiris<-iris %>% rowwise() %>% mutate(mak=max(Sepal.Width,Petal.Length))What I want to do is find that maximum across a range of...
View ArticleWhen developing the same package for R and Python, do you put them in one...
When developing the same package for R and Python, should I put them in one GitHub repo or separate repos?What's making it a tad bit trickier is that the Python package is calledgood_name, and the R...
View ArticleHow can I conduct (and plot) a chisquare test for pairwise combinations of...
I have data from a series of behavioral choice tests where I offered my test subjects (ladybugs) each combination of three substances: A, B, and C (that is, AB, BC, and AC). I want to evaluate if they...
View Article