I have a data like this:
I want to find the average salary of all employees- As, Bs, Cs and Ds. I would like to know if there is any short cut to do the same as the number of employees is very large ...
I have two data sets, both with dog breed names. I'd like to combine the data sets somehow, but a lot of dogs have multiple names, so for instance African Hairless Dogs are also called African ...
Here is a reprex:
> pryr::mem_change(x<- 1:1e7)
Registered S3 method overwritten by 'pryr':
My query is ...
I am a complete beginner in R. This is the first code I've tried to run in Rstudio:
# CREATE DATA ##############################################
x <- runif(100, 0, ...
help me to make relogit classification in r.
I had done some ways to create the table but ended up with some errors
my relogit model is
I have several csv files (let say A.csv, B.csv, ...) in several folders let say (F1, F2,...). I want to read all files in a way that cbind A.csv, B.csv of each folder and create main dataframe for ...
I have a RStudio Project with a history of git commit history.
I would like to upload this Project incl. the git commit history to Github and see the commit history on Github.
I can create a new repo ...
Given a matrix like:
m <- matrix(ncol = 4, nrow = 3)
m[1,] <- c(5,...
I'm trying to create a range of colors to reflect degrees of intensity in my crosstab plot. For example, values 0-33 get assigned light green, 34-66 get assigned a standard green, and 67-100 get ...
Hi everyone. I'm learning text_mining. When I learn get_sentiments("afinn"), The console confirms that is not valid to get input_text. I make sure that I'm running these code in R kernel from Google ...
I am a beginner in R. I used cut function in R to bin my data. My data starts from 0 but after cutting the lower boundary has a negative result and I have no idea why this happened.
My code is:
Rownames of a dataframe disappear upon sub-setting:
a <- LETTERS[1:10]
b <- rnorm(10)
dfa <- data.frame(b)
rownames(dfa) <- a
dfa2 <- dfa[1:8,]; dfa2
I'm noob in coding, so i'm having a hard time finishing assignments. i wanna get some help..
Using ifelse and seq commands in R, calculate the sum of numbers that are evenly divided by 6 between 1 ...
I have a column of data I want to filter on with the following values:
I want to return a table with just the rows that begin with 0.
Note: This is a homework assignment. I'm looking for guidance, rather than the answer.
Hello, I'm trying to create a linear regression for the state population from 2010-2019 and use it to predict ...
I've been trying to plot manually labelled significance bars for a subset of groups on a ggplot2 barplot using ggsignif or ggpubr without much luck. The data is something like the following MWE:
Why sometimes does attribute() not show class attribute, while class() does?
Is class still an attribute, even if attribute() doesn't show it?
For example, a matrix:
> m <- matrix(data=1:12,...
I'm trying to create 301 regressions and save their residuals to a dataframe with a loop. The regressions have the state gdp by industry on the left and needs to have the corresponding US gdp on the ...
> gender %>% arrange(desc(age))
# A tibble: 18 x 3
age sex pop
<chr> <chr> <dbl>
1 62+ Female 51
2 62+ Male 167
3 55-61 Female 98
4 55-61 Male ...
Here is my data:
 NA NA
 NA "EP, IP, RA, SH"
 "EO, ...
I want to create a data frame based on the existing data frame (26 columns by 32 rows) that includes an average of every 3 rows and columns (3 by 3) as one value in R. I tried rollmean but it only ...
I have no access to git on the command terminal so I am using the git2r package to version control my project in R. It works well apart from the fact that I can't generate a nice graph to visualise my ...
When using geom_bar with stat = "identity", the y-axis max is the sum total of all values. In this example, I want the y-axis max to be 100 rather than 300 and the stacked bar to show the proportion ...
So, I want to calc the mean of values in a time series as it goes along. It's super easy in excel, let me show you what I mean:
The window size increases by 1 for each row down. I tried to do this ...
How would I create side by side pdf viewers with text above in Shiny?
Not sure where to start.
I know I can use tags$iframe(style = "height:100%; width:100%;", src = "sample.pdf") to create a pdf ...
I have the following data frame in r:
Using R, I need to duplicate a set of dates. For example, if my dataset was:
Date | Count
1/1/2020 | 5
What I want to be able to do is have the following in a single column:
I have this variable:
names<-c("Sophia Abbe", "Olivia Abbett", "Emma Abbey", "Ava Abbitt", "Isabella Abbot", "Mia Abbott", "Aria Abbs")
I want to abbreviate the first names and place them into a ...
I need to add three vectors (salinity, temp and pH) to my NMDS plot. Here is my code for my NMDS plot:
#make community matrix - extract columns with abundance information
com = pc[,4:ncol(pc)]
I'm new to the spatial side of R and trying to import a kmz file from Google Earth. I opened the file in Google Earth and saved it as a kml file.
However, in R, I get the following error:
I have a data set named master that contains survey data, structured like:
Pid state msr_01 foot_01 msr_02 foot_02 … msr_n foot_n
I want to have n data sets fetched from master, like:
I have a png file that I want to convert non-black pixels to white. This is pre-processing for OCR. How could I easily do that in R? Specifically, I would like to use the Magick library. Thanks!
I would like to identify the duration of an activity that start at t1 and end at t7. The starting point is t1 that records the occurrence of an activity at t1_1 , t1_2, t1_3 and so on. For example in ...
I've got a linux server running RStudio, and I'm trying to connect to an SQL Anywhere database.
I have the drivers installed and configured, and I can connect using iSQL. When trying through RStudio, ...
I'm having trouble understanding the arguments for rgl::plane3d required to draw a plane spanned by two vectors (x0, x1), going through a given point (O=origin). This is for a diagram explaining ...
This may be difficult, because I cannot share my data, and when I tried to reproduce the error in another example it did not work. I am attempting to make a gganimate figure of census block groups to ...
I have a bit of a complex issue and appreciate any advice. I have about 100 csv files corresponding to different years of data collection that I have brought into R as a list. I need to merge them, ...
I'm beyond frustrated trying to get this code to run again. This code worked before and I submitted the assignment in full, but I am trying to use it for my project and now running this code causes R ...
I have a data set with a Locations column and other columns.
Locations <- c("Test1", "Test2", "Test3", ..."Test60")
I also have several Rmd files.
files <- list.files(pattern = "[.]Rmd$")
I'm trying to add a second caption in my ggplot2 graph.
Similar to how this graphic was done by this economist
Here is a basic plot I made where I know how to add one caption on the bottom right, ...
I'm trying to write some code to find a specific vector in a huge array of vectors and return the indexes of where copies of that vector appear. In an attempt to debug, I'm trying to learn the ...
I am trying to perform sensitivity analysis for a toy function using the morris method.
x<-morris(morris.fun, nfac, npoints,design = list(type = "oat", levels = 100, grid.jump = 5))
I have a variable list of column names in a data.table, and would like to apply the same filter to all of them to subset the rows of my table (i.e. give me the rows where all the columns in the list ...
I want to make a scatterplot with certain data points color-coded based on a grouping variable. I want to do this with base R functions. My dataset looks like this:
Group x y
Having some issues trying to get the 'fill' option working in the chartjs R package -- working it into a shiny app. Any examples or suggestions where the 'fill' parameter is passed would be awesome. ...
I am attempting to use R to clean the output data from the following SQL command however when it is done loading it results in an empty data-set. The primary purpose of the query is to create multiple ...
I have done a barplot in RStudio successfully, but I want to decrease the space between the categories (CPLEX and Heurística), but I can't do it. My objective is to make this figures thinner since I ...
Is there a nice way within readr to read text files that have metadata headers of variable lengths? So far, I am manually deleting the header, but would definitely prefer to not change my raw data in ...
Using ggplotly I am attempting to have the content of the hovertext box dynamically change with the mouse cursor, but have a fixed position off of the plot. I have attempted to adjust the 'hoverlabel' ...
I am trying to do a graph with 2 different set of data, like this example:
t <- data.frame(x=c(3,5, 7), y=c(25, 25, 27), text=c("t1", "t1", "t2"))
test <- data.frame(x=c(1:10),...