Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing index pages (211398 articles)
↧

Avoid "Useful links" entry in seealso section of function documentation [closed]

I have created a package (say triplclust) that has a function (say triplclust()) with the same name as the package name. When I enter ?triplclust in the R shell, the URL given in the DESCRIPTION file...

View Article


sf dissolve/remove inner borders of POLYGON

This code creates the desired outline of two combined shapessquare.df <- data.frame("x"=c(0,0,1,1,0),"y"=c(0,1,1,0,0),"ID"=rep("square",5))square <- st_cast(st_combine(st_as_sf(square.df,coords =...

View Article


mlr3 selector_cardinality_greater_than() returns target name

Trying to make a learner that makes predictions on the religion of a country from its flag features using mlr3. My learner of choice is lrn("classif.svm") and data of choice is the flags dataset from...

View Article

Extract the first (or last) n characters of a string

I want to extract the first (or last) n characters of a string. This would be the equivalent to Excel's LEFT() and RIGHT(). A small example:# create a stringa <- paste('left', 'right', sep = '')a#...

View Article

Join data frames by group between start and end dates

I have two data frames:df1 contains three columns: start date (date_start), end date (date_end), and severity classification (category)df2 has one column of dates (date) that advance by one day for the...

View Article


assign dates to weekly periods [duplicate]

I have a large dataset containing tracking data that I want to bin on a weekly basis. I'm trying to figure out the simplest way to approach this, but they seem to get complicated quickly.One option I...

View Article

Image may be NSFW.
Clik here to view.

Adding Mean and SD text to boxplots with multiple groups

I want to create a two group boxplots using ggplot2 with text for mean and sd (not only points). But, I tried to create points first using the following code:ggplot(data.boxplot, aes(x = Component, y =...

View Article

R: Determine redundancies and unique values in a set of columns

I'm hoping to determine when the values in a set of columns are redundant, documenting it in a new column multi? where 0 means only a single value is seen, 1 means multiple values are seen. When the...

View Article


Create HTML file via rmd with custom CSS

I have a rmd-file to create an HTML output.output: html_document: toc: false df_print: paged number_sections: true css: "own.css"It works well.The HTML code of the output creates a view with a max...

View Article


RStudio to create html file via rmd with custom css

I have a rmd-file to create an html output.output: html_document: toc: false df_print: paged number_sections: true css: "own.css"It works well.The html-code of the output creates a view with a max...

View Article

R error in geom(line): Aesthetics must be either length 1 or the same as the...

My codeFor a university course i have to plot the inferred excess mortality up until 2019 and as of 2020. However, when running my code it keeps saying i have an aes error: Error in geom_line():!...

View Article

Running R from cmd

I can't run R in cmd. I am using my company's computer, thinkpad, windows 7.My issue is similar to this post:Running R from cmd in windowsHowever, it's not resolved. I already tried dragging the r.exe...

View Article

Programmatically dropping a `group_by` field in dplyr

I'm writing functions that take in a data.frame and then do some operations. I need to add and subtract items from the group_by criteria in order to get where I want to go.If I want to add a group_by...

View Article


Image may be NSFW.
Clik here to view.

Why do the slices of my pie chart have different radii and wrong proportions?

I'm trying to create a pie chart to visualise the distribution of survey answers across a calculated value called confidence_class. Here is a summary of the data that I'm trying to present. What am I...

View Article

Image may be NSFW.
Clik here to view.

Changing the x-scale and its breaks in a cumulative 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 Article


Image may be NSFW.
Clik here to view.

Misalignment between a raster overlay and DEM in rayshader 3D maps

I am using the rayshader package to create a 3D terrain visualization of a certain area. My R code is as follows:# ─────────────────────────────────────────────────────────# 1. Setup#...

View Article

How to select last N observation from each group in dplyr dataframe?

Given a dataframe:df <- structure(list(a = c(1, 1, 1, 2, 2, 2, 3, 3, 4, 4), b = c(34, 343, 54, 11, 55, 62, 59, -9, 0, -0.5)), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame"))I want...

View Article


Error in scale_color_manual(): ! Continuous value supplied to a discrete...

I have a simple dataframe:seriestfvaluemaxtwdgro_yrfrostflagsversion1922595612026-03-09 12:45:001175.011750.00FALSENA0.1.42922595612026-03-09 13:00:001173.011752.00FALSENA0.1.43922595612026-03-09...

View Article

post request with httr

I am new to httr. I am trying to use this geocoding api: https://geo.api.gouv.fr/adresse. I want to pass a csv file directly from R, as given in their example:curl -X POST -F data=@search.csv -F...

View Article

Splitting data in R by time and occurrence of a incident, proportional hazard...

I have a question: I am trying to build a proportional hazards model with a time-varying constant.Effectively, the question is the occurrence of an illness following a traumatic event. The traumatic...

View Article
Browsing index pages (211398 articles)


Latest Images