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

Advice on what model to use to perform a formal analysis [migrated]

I am using the data psid from the library faraway and want to investigate the interaction between sex and year. Specifically, as the year increases does gender impact income less?I've done some...

View Article


Image may be NSFW.
Clik here to view.

Plot categorical variable

I am new in R, and I follow the instruction slides to plot:The survey[["Program"]] is the categorical data column from the data frame. > survey[["Program"]] # returns the Program column as a vector...

View Article


Looking for how to use separate() with multiple separators in R (ClinVar...

Dear StackOverflow community I'm a biologist and I'm working with a disease/genetic variants from ClinVar official database. My aim is to extract all gene names, transcripts and variants from this...

View Article

Image may be NSFW.
Clik here to view.

white space between title and plot in ioslides

I am using the default theme of ioslides for a presentation, and I have difficulties with arranging a plot on the slide.I use the following code for the respective slide:```{r crint1, fig.width = 7,...

View Article

Please solve this problem of R studio: No data provided for "dense_3_input"....

I'm new to R studio. I have a serious problem with the code that I have to solve. I've tried to make a neural network that predicts 1 class using 7 attributes with a dataset that dimension(1259, 8)....

View Article


Image may be NSFW.
Clik here to view.

R Studio crashing not at initialization. Error: Error occurred during...

Some context on my environment:I am running R Studio in a docker container called rocker/verse. I downloaded this dataset from Kaggle, which has about 470 MB.When working with it, at some point RStudio...

View Article

Image may be NSFW.
Clik here to view.

Plotting both state AND county boundaries on same map using plot_usmap from...

I would like to create a map of the US showing both state and county boundaries (i.e. state boundaries in a different color). I typically do this using either shape files that I import or using...

View Article

How can i reshape this data to look like this? [duplicate]

Sorry if this is a bit confusing, but I need to reshape my data from the top part of my photo to the bottom. I have rows of multiple of the same ID's, however I would like to separate them out into...

View Article


Evaluate a condition in a row and return a certain value if the condition is met

So I am somewhat new to R and I'm trying to return a column value based on a condition which is proving rather difficult for me to figure out!I have two databases I'm working with - One is generally 70...

View Article


linear regression: comparing R2 in the full model to R2 under k-fold...

Below is R code that does the following: 1. Generates data for linear regression (4 predictors, multivariate normal data, based on a correlation matrix) 2. Runs 10-fold cross-validation using caret,...

View Article

Image may be NSFW.
Clik here to view.

Common breaks and free axes for overlapping lattice histograms

What is the required incantation to achieve an overlapping, faceted lattice::histogram with common break points (across groups, but potentially varying across panels)?For example, assume I want the...

View Article

How Sentiment Package Works?

I'm really interested in sentiment analysis and one of the package i can use is sentiment package along with rstem. i'm currently using R3.5.5 and R-studio v1.2.5033 because the sentiment and rstem...

View Article

How to extract unique string in between string pattern in full text in R?

I'm looking to extract names and professions of those who testified in front of Congress from the following text:text <- c(("FULL COMMITTEE HEARINGS\\", \\" 2017\\",\n\\" April 6, 2017—‘‘The 2017...

View Article


I have two different classes in one column. How to test normality of each of...

A newbie in R. Considering this is my situation:(Actually my real situation is much more complex)set.seed(100) df = data.frame(SEX=sample(c("M","F"),100,replace=TRUE),BW = rnorm(100,80,2)) One column...

View Article

Image may be NSFW.
Clik here to view.

custom layers in R Keras using adjacency matrix

How can I create custom layers in R keras or tensorflow using adjacency matrices between the nodes in different layers and fully connected layers in the last N layers for multi-output regression?Any...

View Article


Equivalent of curve() for ggplot

Is there an equivalent method for plotting functions using ggplot to the curve() command employed in base graphics? I guess that the alternative would be to just create a vector of values of the...

View Article

How to plot a function curve in R

What are the alternatives for drawing a simple curve for a function likeeq = function(x){x*x} in R?It sounds such an obvious question, but I could only find these related questions on stackoverflow,...

View Article


Image may be NSFW.
Clik here to view.

Error when using ft_one_hot_encoder() in sparklyr

I have a dataset with a categorical variable that I want to encode using one-hot encoding in sparklyr. Below is the table head, and the code I'm using: tbl_name %>%...

View Article

How to rotate 3D Scatterplot

Below is a code that works using the scatterplot3d() function to run a 3D scatterplot of height vs weight vs volume where points are a Class value between 1-6. The angle is currently at 45 degrees and...

View Article

R error "sum not meaningful for factors"

I have a file called rRna_RDP_taxonomy_phylum with the following data : 364 "Firmicutes" 39.31 244 "Proteobacteria" 26.35 218 "Actinobacteria" 23.54 65 "Bacteroidetes" 7.02 22 "Fusobacteria" 2.38 6...

View Article
Browsing all 205904 articles
Browse latest View live


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