Questions tagged [r]

132985 questions
1

votes
0

answer
92

Views

Singularity error when doing Tobit regression

I'm trying to estimate a standard tobit model which is censored left at zero. Variables are Dependent variable: Happiness Independent variable: City(Chicago,New York), Gender(Man,Woman), Employment(0=Unemployed, 1=Employed), Worktype(Unemployed, Bluecolor, Whitecolor), Holiday(Unemployed, 1day a wee...
Daniel Cho
1

votes
1

answer
53

Views

how to combine all my files in global environment using one column

I have loaded as many text files as possible from a folder in my global environment Now I want to merge them into one dataframe As an example I mention 3 data set and a desire output df1
1

votes
1

answer
44

Views

Creating a bar chart in R from data in a file

First I have created two vectors and put them together Vectors: VektorLHI and VektorRHI sumLHIundRHI
Silvia
1

votes
2

answer
51

Views

How to eliminate the through-line from a legend element in R using ggplot

I'm having trouble eliminating a black through-line from an element in my legend. The black line is in the '% of Hires by Casual Users' element. Below is my code, followed by a link to the output plot EDIT - please note that I've added code to reproduce the problem elsewhere. This data is random and...
Daniel Patterson
1

votes
0

answer
76

Views

R parallel rocessing with for loop in function

I am building a parallel processing loop which has a for loop nestled inside. for simplicity sake I am only including one line of code within the function and for loop but in reality there are about 1000 lines of code. In this small example, I am building a grid for which I would like to iterate ov...
CooperBuck
1

votes
1

answer
195

Views

How to modify highcharter htmlwidget code

I want to change the core code of the highcharter in R (the requirement comes from this post). I want to change core code of the highcharts in R as I know how to modify it in javascript: (function(H) { (...) H.seriesTypes.column.prototype.translate3dShapes = function() { (...) point.shapeType =...
OmG
1

votes
1

answer
56

Views

Diagram doesn't show in Shiny

I have a Shiny application that shows the relationship between race and number of employees in Silicon Valley companies. The toolbar on the left side is visible but the plot is not showing. How should I change my code? Here is the code: library(shiny) library(ggplot2) library(dplyr) bcl
Viola
1

votes
0

answer
51

Views

Inconsistent figures with R png() device when type is changed

I've made a chord diagram (from circlize package) for population movement and when I tried saving it using type='cairo-png' from png() device, it gives me a different one to the default png() device or the one seen from R studio plot panel. Below is the issue presented with some random data. I could...
M_Shimal
1

votes
0

answer
31

Views

How to fetch data in R by executing command in excel?

I have to fetch data from Reuters and they provide an excel plugin for that. The problem is that my excel is crashing if I try to fetch too many variables at the same time. I was wondering whether I can do it from R via some excel connection. In general I want to give the command to excel (from R),...
Nikhil Vidhani
1

votes
0

answer
123

Views

Error in colnames

Could anyone help me with some little problem? When I plot the frontier I get the following message: 'Error in colnames
Yury Bobr
1

votes
0

answer
306

Views

Connecting to Azure database for PostgreSQL from R

I created a PostgreSQL server on Azure, but I am not able to connect to it from R. I am able to connect to it using pgadmin though drv
let_there_be_light
1

votes
1

answer
64

Views

Unable to run edit() command in RStudio

I have just started out on R and have hit a roadblock. I can't seem to run the edit() command in RStudio. Here's what I have tried 1. Changing the RSTUDIO_WHICH_R environment variable 2. Fixing the warning messages which were displayed every time I opened the RStudio. 3. I have even reinstalled R an...
Regime
1

votes
0

answer
264

Views

Knitr ioslides: customize code chunk size

As per this answer and other resources, my understanding is the when setting up CSS for an Rmarkdown presentation, code.r{} should control the parameters for echoed code, while pre{} should control the size of the output. However, pre{} seems to be changing both and code.r{} is doing nothing. Am I d...
Thoughtcraft
1

votes
0

answer
86

Views

How to find a cut set of edges in a graph in R

In R, there is the minimum.size.separators function from igraph package, that find all vertex sets of minimal size whose removal separates the graph into more components. What I want to know is if there is something equivalent in R for edges, i.e., if there is an equivalent function that find all ED...
Dani Depi
1

votes
1

answer
219

Views

R shiny modify a specific element in a reactive table

I have a small shiny app that is designed to read in from a data set, and then calculate the average time per element, grouped by category. My dataset is a more complicated version of: item time category apple 13 cat1 bobcat 6 cat2 cement 15 cat1 doomsday 15 cat1 elephant 7 cat2 after reading in t...
omgitsjessie
1

votes
1

answer
143

Views

plot with ggplot in for-loop doesn´t compile to PDF

I created a report using knitR (.Rnw) to compile it as a PDF. As I would like to plot the same figure for every single questions I created a plot in a for-loop. Unfortunately I get a warning in the PDF and don´t realy get what causes the error... Here is the chunk where I believe the problem starts...
klamsi
1

votes
1

answer
512

Views

R sink(): Error, cannot split the message connection

I am trying to log the errors and warnings of an R script into an external file. At the same time I want to be able to see the errors and warnings in the console in RStudio (useful to develop and debug). I am trying to use the following code: logfile
user2348684
1

votes
0

answer
174

Views

Why Error() in aov() gives three levels?

I'm trying to understand how to properly run an Repeated Measures or Nested ANOVA in R, without using mixed models. From consulting tutorials, the formula for a one-variable repeated measures anova is: aov(Y ~ IV+ Error(SUBJECT/IV) ) where IV is the within subjects and subject is the identity of the...
JMenezes
1

votes
3

answer
83

Views
1

votes
1

answer
72

Views

Get value from mpfr (R) generated list

I m trying the following part of my code. where I got numbers between 0 and 1, that I need for the rest of my calculations. V
ayoub essourni
1

votes
1

answer
293

Views

Changing date format when plotting xts object in R

Sadly this answer here seems to not work for me. From what I saw in the documentation, in the latest version, 0.10-1, the major.format parameter has been removed, opposed to previous versions, like 0.9-7, which has the major.format, that would solve easily my question. It seems such a major feature...
Miguel
1

votes
0

answer
56

Views

Plotting numbers of features in EBImage in R

I have a question regarding the computeFeatures function of EBImage. I used the following code to compute the features. biocLite('EBImage') library (EBImage) Image nmask = opening(nmask, makeBrush(5, shape='disc')) > nmask = fillHull(nmask) > nmask = bwlabel(nmask) Cell bodies are segmented using...
TwanK
1

votes
0

answer
264

Views

Warning in gzfile(file, “rb”)

My application is running perfectly fine in local machine but when uploaded to shinyapps.io its throwing the following error. Warning in gzfile(file, 'rb') : cannot open compressed file 'model2.RDS', probable reason 'No such file or directory'. model2.RDS file exist in the same directory where ui.R...
1

votes
0

answer
135

Views

How to supply multiple lists to 'lapply'?

My objective is to find svytotals of all the variables of a dataframe which contain the term 'INCOME'. I have to do this for multiple files. This is what I have done so far (thanks to stack overflow)- Code- library(sqldf) library(survey) filenames=list.files(path=mypath1, glob2rx('*2014*rev*.txt')...
user7844805
1

votes
1

answer
29

Views

Show both 'active' and 'inactive' plots in knitr html output

For several correspondence analysis packages, single plot function generates multiple plots. The first plot is active, and the rest are inactive. Is there a way to print all plots one after another in the knitr html output. I am trying the following, which is not working. ```{r fig.keep='all'} libra...
S Das
1

votes
2

answer
1k

Views

Error in `[.data.frame`(ozone, , 2) : undefined columns selected

I wanted to Represent scatter on a graph by using plot() function and passing it a data which is a file in my local file system, but I'm getting this error, I tried to set names for the header with colnames() function but same error ozone Error in plot(O3, T12, data = ozone, xlab = 'T12', ylab = 'O...
AbdeAMNR
1

votes
0

answer
364

Views

How to fix shinyapp error which is taking too long to startup?

My shiny app works fine locally, but when I deploy it on the server (this app), it's fetching following error: I looked at the logs and it says 'out of memory'. I checked that shiny allows memory usage up to 1 GB for free accounts. But when I looked at my app's memory usage it's hardly touching eve...
Piyush Verma
1

votes
1

answer
97

Views

Password recovery using email

I have a table called users with 3 columns (username, password, email). When a user forgets his password, he needs to insert his email to receive his password by email (password recovery). I have two questions: Why do I always get the message User does not exist? In the second observe, is there a mo...
Ester Silva
1

votes
0

answer
768

Views

Sobel edge detector in R?

I am working on an R assignment about Sobel edge-detection. Unfortunately the video tutorial I was following uses R for every other task, but switches to python for image processing - I am guessing he did not find any useful R package for image convolution type work (this tutorial is from last year)...
Manojit
1

votes
0

answer
301

Views

Scraping YouTube comments

I'm trying to scrape several comments on YouTube but my id doesn't work and I don't know if i have to use the API or the client id/secret: >id api client secret
Hey
1

votes
1

answer
160

Views

Unable to execute R code on U-SQL using R extensions

I have been trying to execute R code on U-SQL using the R extensions mentioned in the documentation (https://docs.microsoft.com/en-us/azure/data-lake-analytics/data-lake-analytics-u-sql-r-extensions). When I try to execute the example scripts mentioned in the link above, it throws the error: C# err...
Absolute Beginner
1

votes
0

answer
222

Views

r OpenMP crashes

I'm having trouble with openMP crashes. Here's a simple example library(data.table) library(caret) dt1
JerryN
1

votes
1

answer
453

Views

install PerformanceAnalytics on R version 3.4.2 (2017-09-28)

I tried to install PerformanceAnalytics on R version 3.4.2 (2017-09-28), and I get a series of error messages. The most meaningful seemed to be that PerformanceAnalytics was not compatible with my version of R (which is the most up to date one). Then it came up with: make: *** [momentF.o] Error 1 ER...
user8369515
1

votes
1

answer
195

Views

R Shiny dynamic list variable to multiple rows

I am trying to create a sidebar that outputs the columns of a datatable and the number of unique values in each column. The code below works for the names but when it comes to the unique values I can only get it to display if the list variable is unlist()ed. I could not find any articles that talk...
terrangreen
1

votes
0

answer
147

Views

missing predictor data model in JAGS

I'm trying to program the simplest missing data model in JAGS. One predictor (with a few missing data points) and one outcome variable. I know the example is not the most useful or realistic, but it's helping me work out the model kinks before I go on to a more complicated missing predictor data sce...
Sean S
0

votes
0

answer
15

Views

Splitting variable into two groups

I am trying to split a numeric variable (Age) within the AdultUCI dataset into two groups. One that is =50. I cannot get past how to do this. I have tried a number of different things, but all of the code returns an error message. adult[1:2,] adult[[ 'age']]
Chuck
0

votes
1

answer
13

Views

A Simple `paste0` Command is Not Working Within a `draw` Command? (ComplexHeatmap, r)

As part of using ComplexHeatmaps, I need to create a string which will allow me to plot three maps together. If I have heatmaps A, B and C, I will need to do this, AllMaps
Solebay Sharp
0

votes
0

answer
11

Views

Problems of merging excel files by row

enter image description hereI have imported 90 excel files by creating a directory (dir) and using (lapply). All of the excel files have 5 similar variables and different numbers of observations. Then I applied (map_dfr) to combine all the files into one file but I found that the new data frame has...
Kamrul Hassan
0

votes
5

answer
28

Views

Extracting .txt data into a meaningful table for analysis using Python (or R)

I'm working on an engineering project in which I'm using machine performance data from archives. The machine produces one data set approximately every 5s and this data is then available date-wise in a number of .txt files with each file containing data in the following format. The data shown below...
kd68
0

votes
0

answer
19

Views

Error: installation of package ‘ranger’ had non-zero exit status

I am experiencing great difficulties in installing the package ranger. Here is the error message that I am getting: ERROR: compilation failed for package ‘ranger’ * removing ‘/home/ibraim/R/x86_64-pc-linux-gnu-library/3.5/ranger’ Warning in install.packages : installation of package ‘range...
user249018

View additional questions