正规365体育投注

Questions tagged [r]

正规365体育投注 R is a free, open-source programming language and software environment for statistical computing, bioinformatics, visualization, and general computing. Please provide minimal and reproducible example(s) along with the desired output. Use `dput()` for data and specify all non-base packages with `library()` calls. Do not embed pictures for data or code, use indented code blocks instead. For statistics related questions, use http://stats.stackexchange.com.

Filter by
Sorted by
Tagged with
0
votes
1answer
7 views

IF columns in X are FALSE, drop the same columns in Y?

Trying to have specific columns within a logical vector (X) communicate with the same columns in a character vector (Y), so that if any columns in the logical vector are FALSE then those same columns ...
0
votes
0answers
6 views

Error: `position` must be either a string or a Position object, not an S3 object with class labels

I've made a simple barplot, with the following code: ggplot() + geom_bar(aes(y = Percentage, x = Medicalposition, fill = DLTIrecognized), data= DLTIrecognized_long, stat="...
0
votes
0answers
6 views

how to perform hierarchical clustering with predifined clusters/classes in R?

I have a database I did hierarchical clustering on (with agnes() ) and it worked well (I did it like here described: http://uc-r.github.io/hc_clustering. Now I want to compare manmade clusters or ...
0
votes
3answers
23 views

How to keep other columns when using dplyr in R?

I have a similar problem as described How to aggregate some columns while keeping other columns in R?, but none of the solutions from there which I have tried work. I have a data frame like this: df&...
-2
votes
0answers
10 views

lapply function reads second row as variable name

I am using lapplyfunction to run generalised linear model on thousands of outcome variables. The following error appears : Error in : object '0.1813824' not found ...
0
votes
2answers
16 views

Cut day into multiple parts

To find the right aggregation level for my data, I have to split the day into frames of different sizes. Example data: da = data.frame(timestamp = c("2016-01-24 01:17:37 GMT" ,"2016-01-24 02:09:41 ...
0
votes
0answers
15 views

Generating mean column calculated over a time window defined by a categorical variable in R

I have a data frame which looks like this: dput(car_weekly[1:10, ]) structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), freq = c(0, 4.34, 1.24, 0, 5.26, 0, 7.12, 3.70, 0, 0), event = c(0, 0, 0, ...
0
votes
0answers
12 views

Transform data visualization with ggplot and facet grid into a table

The facet_grid() function in ggplot is very useful for visualizing multiple dependencies between variables. Sometimes however, there is a limit to which it still makes sense to visualize the data as, ...
-1
votes
1answer
18 views

Label every n-th x-axis tick on boxplot

I would like to remove every n-th x-axis tick labels from a geom_boxplot (ggplot). For example take this dummy dataframe: Lat <- c(rep(50.70,3), rep(51.82,3), rep(52.78,3), rep(56.51,3)) y <- ...
-3
votes
1answer
20 views

Extract field and values from a string in R [duplicate]

I am having this string: x <- '[{"code":"B1182","description":"Tire pressure monitor module","faultInformations":[{"description":"---"},{"description":"TRUE","description_eng":"TRUE","...
1
vote
3answers
28 views

Read a 20GB file in chunks without exceeding my RAM - R

Im currently trying to read a 20GB file. I only need 3 columns of that file. My problem is, that im limited to 16 GB of ram. I tried using readr and processing the data in chunks with the function ...
1
vote
0answers
15 views

Generate predicted values from a mixed model with intercept removed

I'm having some trouble using predictInterval to generate predicted values from my lmer mixed model with the intercept removed. the simulated dataset logreads <- rep(1:16, 20) arthropod <- ...
1
vote
2answers
22 views

Writing function around statistical tests in R

I'm writing a function for my (working) R script in order to clean up my code. I do not have experience with writing functions, but decided I should invest some time into this. The goal of my function ...
-2
votes
2answers
23 views

R language count rows of dataframe matching a criteria

I have a dataframe population with Height and Weight Height Weight 1 1.4349813 53.73766 2 1.6875582 61.83858 3 1.4952729 51.64203 etc.... How can I count how many of these people have a ...
2
votes
3answers
38 views

R - Fastest way to loop subsets and get outputs using datatables (calculating monthly measures)

I have a problem where I am hoping to calculate some monthly measures for different entities but the code I am currently using appears to be very slow. I am wondering if perhaps you may know of a ...

15 30 50 per page
1
2 3 4 5
22282