2,462
questions
0
votes
0
answers
20
views
Adding error bars in ggplot and organizing data with plyr
I want to plot mean daily duration for 3 sites using line/dot plot with SD error bars
y=duration x=day
I am struggling to add error bars to my line/dot plot. When i enter the code it is not ...
2
votes
0
answers
444
views
how can I install the "plyr" package in R version 4.4?
After updating R to version 4.4, most of the packages are gone and I need to reinstall them. Now, I'm having trouble downloading the "plyr" package, even though the github pages say that the ...
0
votes
0
answers
183
views
Play m3u8 containing http urls in it
I need help. I have an m3u8 file with channels in this format:
#EXTM3U
#EXTINF:-1 tvg-id="5f4f1f6cb0c8e030be45f8a7e608ec73",AltynAsyr
http://192.168.0.85:9981/stream/channelid/1813991263?...
0
votes
0
answers
99
views
blazorise video component source change hls media can not play
Blazorise's video component plays m3u8. When I change the URL in the parent component, the source in the video's html will indeed change to the new URL, but the media is not loaded correctly by the ...
0
votes
2
answers
105
views
Improve efficiency of bootstrap function
I have a large dataframe from which I want to take random samples for each column. I'd like sample multiple times and store the sum of my results in a new dataframe.
My dataframe looks like this:
...
0
votes
1
answer
42
views
R: How to add custom character inside string depends on the group?
How to add custom character inside string containing variable depends on the group variable?
Here is the dummy input dataset:
library(tidyverse)
unit <- c(50, 50, 40, 40, 30, 30, 20, 20, 10, 10)
...
0
votes
0
answers
355
views
Plyr player.source not working for youtube video
I am trying to use Plyr with angular. It works fine for mp4 video file but doesn't work for youtube video. Here's the code
HTML
<div id="video-container" >
<div id="...
1
vote
1
answer
552
views
change video source and caption dynamically on plyr.js?
i'am struggling with the way of adding caption to plyr.js and nothing found so far on the internet
my code is
<video class="player" style="min-width: 100%; min-height: 500px;" ...
0
votes
1
answer
27
views
automatizing ranges with R
I am trying to automatize the calculation of some ranges that have to be integrated later on.
I am doing it without using tidyR, but I believe that applying tidy could help solve the last bottle neck ...
1
vote
2
answers
71
views
How to pass more than one argument to laply?
I would like to run a series of regression models and put the output relating to a particular covariate into an array. I've been able to do this with laply from the plyr package, like this:
set.seed(1)...
0
votes
1
answer
65
views
I do I create one row for each unique timestamp in this dataframe?
I have the following data frame in R that looks like this. Each depth and timestamp have a unique value. I can't figure out how to collapse the data frame to get rid of the NAs and have 1 row for each ...
-2
votes
1
answer
180
views
Sort, sum, and add percentages after "count" in R
I have a straightforward code in R that gives me the number of times a username sent a ticket request.
Data is the source dataframe, and I subsetted by request type "4"
data2 <- subset(...
0
votes
1
answer
107
views
"Error in as.double(x)..." and other error message while creating a function to summarize and graph
long time listener and first time caller here
For a project I am working on, I often end up graphing the same graphs with just different response variables. So I am trying to write a function based on ...
0
votes
1
answer
71
views
aggregating model summaries from list of models
I am running same models several times on different subset of data, for example,
data("mtcars")
head("mtcars")
table(mtcars$cyl, useNA = "ifany")
I am fitting the ...
0
votes
2
answers
339
views
How to fix "Failed to compile. ./node_modules/plyr/dist/plyr.min.js 1947:29"
Failed to compile.
./node_modules/plyr/dist/plyr.min.js 1947:29
Module parse failed: Unexpected token (1947:29)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You ...
0
votes
2
answers
74
views
Data transformation: Select certain observation plus observations before and after the date it was taken R
I have a dataset with 450 observations and variables "date", "year", "site", "number". I want to select the observations with the highest number per site and ...
1
vote
2
answers
90
views
How to summarize several independent variables at once in R?
For example, if the data is like below,
Cultivar=rep(c("CV1","CV2"),each=12)
Nitrogen=rep(rep(c("N0","N1","N2","N3"), each=3),2)
Block=rep(c(...
0
votes
1
answer
47
views
plyr ddply across two dataframes
not sure if I'm using the right function, but I have two dataframes. I want to take the sequence value one by one from df2 and use a function (LCS_score) on it to compare it to each code in df1, then ...
0
votes
2
answers
67
views
adding a data to new column if seperated by "+" sign using R
Following previous question,enter link description here I have extra informations with my data,I included the gene with the data. Since same gene were predicted as different enzyme, results were ...
0
votes
1
answer
32
views
Finding mean, standard deviation, and standard error of the levels of a variable across multiple subjects in R
I'm trying to find mean, sd, and se for nine different conditions across 32 subjects so that I can create a plot. Every subject has a frequency value associated with each level of condition.
This is ...
0
votes
1
answer
54
views
Having a trouble to separate the names in a data frame
I am having trouble separating the names in a data frame. Can anyone help me with that?
Here is the data frame code.
Classe1 <- c("class1", "class2", "class3","...
7
votes
4
answers
163
views
Padding or filling a dataframe in R if I know the range
I'm looking for something similar to bedtools subtract but with dataframes.
For example, say I have the range as a dataframe here:
Start End Value
0 100 P
And I have another dataframe, which is ...
0
votes
1
answer
31
views
How can I add a condition in a function using ddply
I am creating a new variable mydata_weighted.equity for my dataset using the following code:
mydata_weighted.equity <- ddply(mydata, .(TrackerID), function(x)
data.frame(weighted.equity = ...
0
votes
0
answers
715
views
Error in R: non-numeric argument to binary operator
I would like some help with understanding and fixing an error message that I encountered when I executed the command View(combined_data). The error message that appeared was:
r error 4 (Error in ...
0
votes
0
answers
34
views
Filter Rows Based on String AC27 and AC28
im_id
sub_status
status_date
Flag_Status
12345
PD01
01-FEB-2023
12345
PD02
02-FEB-2023
12345
PD81
02-FEB-2023
12345
PD63
02-FEB-2023
12345
AC27
02-FEB-2023
12345
AC27
03-FEB-2023
Cancel Not ...
0
votes
1
answer
34
views
Draw rows based on probabilities in R
I have two datasets. I want to assign for every row of second dataset a "Group" from first dataset based on "Probabilities" from first dataset. Logic what I want to do is as ...
0
votes
1
answer
131
views
create dataframe of r2, residuals, and coeff from linear models
Exactly like this question but how do you also get the R squared value for each model? link
Sample data
test <- data.frame(row=c(1:16),
plot = c(1,1,1,1,1,2,2,2,3,3,3,3,3,3,3,3),
...
3
votes
3
answers
64
views
Calculate pairwise variable-differences in a data.frame/tibble
I have the following dataframe consisting of different variables (A, X, L) that were measured at two different times (t1 and t2). Of course, in the real data there are many more variables (just for ...
1
vote
0
answers
193
views
Adding custom setting in plyr
I'd like to add a custom option to the settings that will set a variable value
For the sake of the argument, let's say it's theme, with the options: light, dark and blue
It will open up the regular ...
1
vote
2
answers
113
views
How to cbind a list of tables by one column, and suffix headings with the list item name
I've got a list of dataframes. I'd like to cbind them by the index column, sample_id. Each table has the same column headings, so I can't just cbind them otherwise I won't know which list item the ...
0
votes
1
answer
212
views
r nested table with row percents
I am trying to create a nested table in R with Row Percents.
This is my dataset:
data("mtcars")
head(mtcars)
I am trying to create a summary table like this:
vs = 0 ...
2
votes
3
answers
96
views
How to reshape long format data and count the values
I think this is a basic question, but it seems to be frustrating me...
I am using R and have data in long format; a data.frame with each value a string. I want to produce a summary table of the counts ...
0
votes
1
answer
139
views
Adding a function to count the number of cases in R
I need to calculate SD, mean, and the number of each category for subclasses defined by two variables. I found the following code from a webpage(http://www.sthda.com/english/wiki/ggplot2-error-bars-...
2
votes
1
answer
89
views
R - Add each vector element into a variable of a dataframe recursively
I have a list of people...
v <- c("John", "Paul", "Annie")
and I want to distribute them recursively accross 14 different rooms.
df1 <- data.frame(ROOM = c("...
0
votes
2
answers
89
views
replacing multiple values seperated by a comma by other values
here are a few rows of my data :
dput result :
structure(list(A= c("2", "1, 2", "2", "2"), B= c("2",
"none", "1", "1&...
0
votes
0
answers
30
views
Error with custom plyr function for aggregating "Mindware" files
Apologies for not having a reproducible example- this involves multiple individual files and I'm not sure how to create an example for this issue.
I'm using a function to aggregate a large set of ...
0
votes
1
answer
141
views
Faster way to map values than plyr::mapvalues() in R?
I am mapping several columns of data and would like to make it faster. Here is what I am currently doing:
datatable$col1 = mapvalues(datatable$col1, from=datatable[value==1, col5], to=datatable[value==...
0
votes
1
answer
71
views
Tidy up rbind(ddply()) R for transforming from wide to long
So I have figured out a solution on how I can transform my data from wide to long. The dataset had 190 columns representing 19 variables for 10 years (and additionally 31 columns that did not require ...
0
votes
1
answer
49
views
transforming complex wide data to long in R, multiple year columns, corresponding values, UTF-8 issues (Duplicate?)
What I have is a wide format, that need to get reshaped and sorted differently. I have 10 columns in total for year, one same year for all rows, different year per column. These I would like to merge ...
1
vote
1
answer
334
views
dplyr fill missing time series values with NA and by group
I have a data frame like so:
library(tidyverse)
#make some data
df <- tibble(ID = c(1, 1, 2, 2),
Year = c(2000, 2003, 2000, 2003),
Value = c(1, 1, 1, 1))
ID Year ...
0
votes
1
answer
106
views
plyr::join_all: Join columns in several objets doesn't work
I have this problem:
# Packages
library(tidyverse)
# Open band file
bands_F <- read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/bands.csv")
str(bands_F)
# 'data.frame': ...
1
vote
2
answers
59
views
Counting unique combinations of values in 1 column and 2 additional columns without duplicates
I have a large df of genomic data for many different tumor samples. One column "mutation" reports the specific variant of a protein detected in the sample. Two additional columns "...
0
votes
1
answer
2k
views
How to add an overlay text over video (using Plyr.io) video player on full screen mode?
I am using the Plyr.io video player which is an open source video player this is its link: The link for plyr.io, and I am using the HTML 5 video player.
However, I have implemented it using the ...
0
votes
2
answers
702
views
iFrame height cannot be controlled , after using plyr and boostrap
As you can see the iframe height changes according to the video, I want the iframe video height to stay the same as I am making a website that allows people to watch youtube videos through the iframe ...
0
votes
1
answer
293
views
Can I append a header row of data with a different number of columns in R?
EmployerID | 1.0 | 20220801
Dairy | Milk | 1.99 | Mary | 2x
Produce | Tomato | 1.49 | John | 1x
Produce | Orange | 0.99 | Nilofar | 3x
I'm working with a pipe-...
0
votes
2
answers
46
views
R code for creating dataframes including unused categories?
I am trying to make all my data frames in r have the same levels in a categorical column so that, when I make barplots of them all, they are comparable with some having "unused factors" of ...
2
votes
1
answer
459
views
aggregate function in R, sum of NAs are 0
I saw a list of questions asked in stack overflow, regarding the following, but never got a satisfactory answer. I will follow up on the following question Blend of na.omit and na.pass using aggregate?...
0
votes
2
answers
235
views
Is there a way to force mutate in R to use single values rather than whole column values?
For example, I have tried:
df <- tibble(x = c(1,0,0,1), y = c(1,1,0,0), z = c(0,1,1,0))
df <- df %>% mutate(pos_seq = c(x,y,z))
#or
df <- df %>% rowwise() %>% mutate(pos_seq = c(x,y,...
0
votes
3
answers
60
views
How to collapse redundant rows together to get rid of mirrored NAs in two columns?
I'm modifying this toy df from this question, which is similar to mine but different enough that its answer has left me slightly confused.
df <- data.frame(id1 = c("a" , "NA", &...
0
votes
3
answers
109
views
How to remove the prefix of each sample
I was stuck in removing the prefix of each sample. I have tried to remove all the number within the sample, but this could not be a good way for grouping. I would like to only keep the sample name as ...