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

Clean Tweets: What are UTF8 and non-UTF8 characters

I am attempting to analyze a corpus of tweets extracted from Twitter. A number of tweets appear in non-UTF characters. For example, one tweet is:...

View Article


How to add a vertical line to a plot from the "mirt" package?

I used the mirt package to create an item information plot. library(mirt) model <- mirt(data, 1, itemtype = '2PL') plot(model, type = 'infotrace', facet_items = FALSE) I try to add a vertical line...

View Article


Split string at separator and create new dataframe

This seems like a basic question so please feel free to point me to another answer but I can't find an answer through my searching.I have a set of 180,000 rows that looks like this:df <-...

View Article

R: Scraping aspx from doPostBack

I am trying to scrape this page to download the file in excel.I've been trying this until now but it doesn't help me:library(rvest)...

View Article

R: how to incorporate write.csv in nested foreach loop

I simplified the problem to below and I know in normal circumstances, I would not use nested foreach loop and I should really use nested for loop. However, I would like to know how this could be done...

View Article


Replace a value on one data set with a value from another data set with a...

This question relates primarly to Alteryx, however if it can be done in Python, or R in Alteryx workflow using the R tool then that would work as well.I have two data sets. Address (contains address...

View Article

R markdown displays only the user name and creation date but no code

I am trying to create a R markdown file for the following code in r studio.This code is done for data analysis project in R programming platform. but the r studio creates the HTML document that...

View Article

How to repeatedly stack same row with certain amount of times [duplicate]

This question already has an answer here:Repeat each row of data.frame the number of times specified in a column 9 answersthis question is related to the post below, however, this is the more general...

View Article


make not found when using dynr

I am trying to run the following code but gets error in last line only. Can anybody tell me what wrong I am doing. I took the code from an article, it goes well untill I cook the model with dynr.cook()...

View Article


Remove strings from text and place into separate columns

I am trying to remove the lat/long coordinates in the string below to place into two separate columns "lat" and "long" in R. I haven't had much luck using separate in dplyr. Any help would be most...

View Article

Repeat each row of data.frame the number of times specified in a column

df <- data.frame(var1 = c('a', 'b', 'c'), var2 = c('d', 'e', 'f'), freq = 1:3) What is the simplest way to expand each row the first two columns of the data.frame above, so that each row is repeated...

View Article

Image may be NSFW.
Clik here to view.

R - Using column indexing in gather function

I'm trying to use the gather function to combine multiple rows and lengthen my wide data. Example data below:Ideally, I want the data to look like the below table so I can summarize info about the...

View Article

Image may be NSFW.
Clik here to view.

Shade an area under density curve, to mark the Highest Density Interval (HDI)

I thought this should be straightforward, but I'm lost, despite tons of information online.My Problem: I have a vector of data points, for which I want to plot a density curve, then color the area...

View Article


Changing a Single Column Across Multiple Data Frames in a List

These questions:Changing Column Names in a List of Data Frames in RChanging names in a list of dataframesBoth have great solutions to changing column names, but the only column name I want to change is...

View Article

Image may be NSFW.
Clik here to view.

Reshaping these datas into the format of panel data in R? [duplicate]

This question already has an answer here:Reshaping data.frame from wide to long format 7 answers The question is shown in the picture :My data is the following:1 2 3 1995 33 44 771996 22 55 881997 11...

View Article


dplyr group_by multiple function arguments via Non Standard Evaluation

I was reading dplyr's vignette trying to figure out how to use dplyr in my function codes. Mid way through it talks about how to use enquos on ... in order to pass multiple arguments to group_by. a...

View Article

r - Calculated mean and sum values group by the first row

I have a dataframe, I would like to calculate all the mean values of x and all the sum of y group by the first row of the dateframe.The dateframe to be calculateThe following link is the result I want....

View Article


Why R isn't replacing the function argument by the given value?

I wrote this simple function to install and import libraries, if they are not installed yet. Here is my code:check_library <- function(my_lib){ tryCatch( expr = { library(my_lib) }, error = {...

View Article

How can i replace the the NULL values in dataframe with Average of Forward...

This question already has an answer here:Replace NA-s with mean values 1 answerReplace NA with mean of values in previous and following row in R 1 answerI've just started using R and i'm trying to...

View Article

How can I add a error bar in dataframe and in ggplot2?

I am making a grouped bar graph using ggplot2. However, I am having trouble adding sd/sem. The standard errors are: '1,2,3,1'. How can I add Error Bar to this bar graph?survey <-...

View Article
Browsing all 205466 articles
Browse latest View live


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