papaja: modify spacing under headings
I am using the package papaja to write an APA-formatted manuscript with R markdown. I would like to modify the default spacing under headings (it's presently too large for my taste). As shown on the...
View ArticleConvert Nested Loop to lapply
I am using two loops. In the second loop, I am incrementing value by 1 and then applying filter based on that and converting it to data.matrix so that matrix multiplication can be done in later steps....
View ArticleSpread data to create unique rows
I have a data frame that I want to reshape so that for each medid, there is only one row. I know that I can use spread to accomplish this, but it's not looking at all how I want to look and I just...
View ArticlePermutation test error for likelihood ratio test of mixed model in R:...
I would like to test the main effect of a categorical variable using a permutation test on a likelihood ratio test. I have a continuous outcome and a dichotomous grouping predictor and a categorical...
View ArticleProblem in creating boxplots with R shiny app
I'm very new to the Shiny app R. I'm trying to make simple boxplots in the Shiny R app for some dataset.Here I am showing some example data in a file df.csv. The data looks like below. Showing the dput...
View ArticleR: Test for overlap of name values in dataframe
I have a dataframe filled with names.For a given row in the dataframe, I'd like to compare that row to every row above it in the df and determine if the number of matching names is less than or equal...
View ArticleIn R, how do I select all variables from one data frame that are in another...
I have two data frames a and b (with more variables). Now I would like to keep all the variables from b and combine a and b together. How should I do? Will appreciate any wise solutions.
View ArticleGet all sourced functions
In R, I am using source() to load some functions:source("functions.R") Is it possible to get the list of all functions defined in this file? As function names. (Maybe source() itself can somehow return...
View ArticleHow do I install RODBC so that is uses unixODBC?
After installing and configuring FreeTDS and unixODBC and confirming they are working correctly, I am trying to configure RODBC. However, I am getting the following results when attempting to view the...
View ArticleFiltering by specific timeframe in R
I have a column with the full date and time ie 2019-01-01 00:00:00. How do I filter between specific time frames regardless of date. For example only displaying data that falls between 07:30:00 and...
View ArticleResize absolute panel and text inside it on different screens (Desktop,...
My shiny application has different absolute panels, but their appearance is different on different screens. In particular, I noticed that the size of the panel and the text inside it, usually present...
View ArticleR knitr: use spin() with R and Python code
With the advent of reticulate, combining R and Python in a single .Rmd document has become increasingly popular among the R community (myself included). Now, my personal workflow usually starts with an...
View ArticleChanging boxplot in graphics to bwplot in lattice
I have a problem changing boxplot in the graphics package to an equivalent in the lattice package.graphics:xx1 <- rnorm(20, mean = 3, sd = 3.6) xx2 <- rpois(40, lambda = 3.5) xx3 <- rchisq(31,...
View ArticleHow can I get the key labels in legend match with the end values in a...
I tried scale_x_continous and guides(fill=guide_legend) but can't get it to work. The legend need to match the end order of the lines which end in the year 2016. So: Action, Role-Playing or a pink line...
View ArticleUnexpected change of column name to V1
When running my code I have 2 issues when executing the code after the line "View(df)". Firstly, I try to delete the first two empty rows, but instead everything gets deleted. EDIT: The selection of...
View ArticleWhat's wrong with edit in R?
I'm a beginner in R I recently learned about the function called edit in internet class. they show the R in Window OS but, my computer is MAC OS I think that's the problem. But I don't know how to fix...
View ArticlePlots (ggplot2) in Rmarkdown PDF cropped
Within R I use the ggplot2 plotting library to create plots. I output a bunch of them and also print \n\n in between them such that they become their own paragraph in the PDF (via LaTeX). Lately (new R...
View ArticlePlot a graph without NA's
Apartment_no <- c('1-SV','1-SH','3-SV','3-SH','5-SV','5-SH','7-SV','7-SH') January <- c('', '', '3','5','9','','15','19') February <- c('5', '', '3','5','','15','','19') March <- c('5', '',...
View ArticleChange orientation of data frame for panel data in R [duplicate]
This question already has an answer here:Reshaping data.frame from wide to long format 7 answersI would like to change the orientation of my data frame. I have following data:df <-...
View Articlehow to get weekly. quarterly and monthly count from a daily data set of a year
I ave data yearly set with daily login data of 4440 employee. i wan to get the weekly, quarterly insight and monthly insights, but i am not bale to understand how do i get this count in R. i have 4400...
View Article