Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 205343 articles
Browse latest View live
↧

Image may be NSFW.
Clik here to view.

What is the easiest way to order boxplots in tidyverse and ggplot in this...

consider the data below to show them in boxplots using ggplot. What is needed is actually ordering the food items which are at home. MWEstructure(list(Site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,...

View Article


Image may be NSFW.
Clik here to view.

In geom_sf_text, how to nudge x and y in aesthetics?

I would like to nudge the x and y position of text in ggplot2, using sf. The justification of text can be modified in aesthetics, which then requires nudging to be also modified similarly, but nudge_x...

View Article


Image may be NSFW.
Clik here to view.

How can I color in one zipcode in a map, RStudio?

I made a zipcode map of dallas using this shapefile: https://gis.dallascityhall.com/shapefileDownload.aspx (Street Files)dallas_streets %>% sample_frac(1) %>% group_by(POSTAL_L) %>%...

View Article

`dplyr::filter` in `mapply`

For the following code I am expecting the same result as for dplyr::filter( tab, A < 3 )tab <- data.frame( A = 1:3, B = letters[1:3] ) mapply( dplyr::filter, .data = list(tab), list( quote(A <...

View Article

I'm getting an error when I try to upload an excel file to my RStudio server

I'm using R Studio Server. When I try to upload a file from my desktop, I'm getting Error: 'path' does not exist: 'data/sweets.xlsx'This is the code I'm using to upload my filesweetsimport <-...

View Article


Residual stationarity test panel data using R

I am running a panel regression in R. I would like to test for stationarity.By doing a test on my dependent and independent variables, I couldn't reject H0 of unit root for one of my independent...

View Article

How to merge data frame based on date between two intervals of time?

I'm working with two data frames. Data frame 1 includes a date, I'll refer to it as the merge_date. Data frame 2 includes two dates, start date and end date.I want to merge data frame 1 and 2 together...

View Article

Image may be NSFW.
Clik here to view.

Image to an excel spreadsheet in R

I have this script so I can convert an image to an excel. However, when I save to Excel, it is saved empty, without the printed image. Do you know why that happens? Underneath, the libraries are loaded...

View Article


Citations in DT:datatable

I am working on a bookdown project where we have large tables that also contain citations. We are outputting in both html and pdf. The problem is that I cannot find a way to make the citations render...

View Article


R regex split when upper case found in middle of the word [duplicate]

This question already has an answer here:Splitting string between capital and lowercase character in R? 1 answerI have some very dirty text data frame and I would like to clean it with R. I would like...

View Article

Integration in R using hcubature

rho <- 0.2 f1 <- function(X) { x <- X[1] y <- X[2] (pnorm(x-10)-pnorm(y-10))^2*(exp(-((x-10)^2-2*rho*(x-10)*(y-10)+(y-10)^2)/(2*(1-rho^2)))/(2*pi*sqrt(1-rho^2))) } library(cubature)...

View Article

how to obtain morphological features of head_token along with lemma in Udpipe?

I am relatively new to Udpipe-environment. Is there a way to extract morphological features of headtokens and along with KWIC in same dataframe in Udpipe? For instance, I would like to get subjects and...

View Article

Image may be NSFW.
Clik here to view.

Unwanted values being added when using complete()

Happy New Year, everyone!I'm having an issue with transforming implicit missing data into explicit missing data. I am summarizing the number of observations of birds at specific survey sites. These...

View Article


create references in each section in Rmarkdown

I want to use Rmarkdown but what I've read is that when creating a bibliography using pandoc, references go at the end of the document:pandoc/citeproc issues: multiple bibliographies, nocite,...

View Article

Error when knitting Rmarkdown using cv template of vitae package

I installed and loaded package "vitae" for making CV in rmarkdown.I open R, go to rmarkdown, templates and chose Curriculum Vitae (Awesome-CV format). I name the document and on clicking "OK", an...

View Article


drop both row and column satisfying condition in symmetric dataframe

SettingMy task looks similar to this one but not quite. Suppose I have a symmetric data frame looking like thisdf <- data.frame( matrix(c(1, 7, 0, 5, 9, 0, 7, 4, 0, 8, 2, 0, 0, 0, 0, 0, 0, 0, 5, 8,...

View Article

R, finding the worst predicted cases in a panel regression

I am working on a model explaining country participation in an international institution. After a Panel Regression using both a random- and a within transformation model, I want to select the cases...

View Article


How to extract Currency Values from Multiple Strings stored in different ways?

I have multiple types of strings in a dataframe's colume like : "Dear ... INR 2,36,22,217.29 on Date 2018-12-22 11:33:42 AM ..... No 8356111112294....."with the currency being written broadly in INR...

View Article

What does %T>% function mean in R?

can you please explain this pipe - %T>% with some examples if possible. I found only one example with the plot:rnorm(200) %>% matrix(ncol = 2) %T>% plot %>% # plot usually does not return...

View Article

Using ggplot2 facet grid to explore large dataset with continuous and...

I have a dataset with >1000 observations belonging to either group A or group B, and ~150 categorical and continuous variables. Small version below. set.seed(16) mydf <- data.frame(ID = 1:50,...

View Article
Browsing all 205343 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>