Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged r

0 votes
1.2k views
1 answer
    I would like to adjust the text on the barplot. I tried to adjust hjust/vjust to display as I like it but it seems like it's not working ... so it's readable without overlapping like the last parts. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I want to find the lead() and lag() element in each group, but had some wrong results. For example, data is like this: library(dplyr) df = data. ... result (the values, not just about the order)? Thanks~ See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    In knitr, the size option works fine in a .Rnw file, the following code generates: documentclass{article} egin{document} <<chunk1, size="huge">>= summary(mtcars ... .987, knitr 1.6 and rmarkdown 0.2.68. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
926 views
1 answer
    Problem I would like to test if an element of a list exists, here is an example foo <- list(a=1) exists('foo') TRUE #foo does exist exists('foo$a' ... FALSE? Is use of with(...) the preferred approach? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I wonder if it is possible to plot pca biplot results with ggplot2. Suppose if I want to display the following biplot results with ggplot2 fit <- ... (fit) Any help will be highly appreciated. Thanks See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
981 views
1 answer
    I have following model x <- rep(seq(0, 100, by=1), 10) y <- 15 + 2*rnorm(1010, 10, 4)*x + rnorm(1010, 20, 100) id ... intervals / prediction bands from the nlme object for the whole population? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I am using knitr (1.9.5 and 1.9.17) and rmarkdown (0.5.3.1), and would like to hold figure position in the pdf output. The generated pdf file is working ... =8.5, fig.pos="H"} plot(cars) ``` More test See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
835 views
1 answer
    I have a dataframe with numeric entries like this one test <- data.frame(x = c(26, 21, 20), y = c(34, 29, 28)) How can I get the following vector? > 26, 34, ... dim(test)[ 1 ]){ X <- cbind(X, test[i, ]) } See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
879 views
1 answer
    Is there a method for moving a column from one position in a data.frame to the next - without typing an entirely new data.frame() For example: a <- ... is there not a quicker way? (Imagine 1500+ columns) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
842 views
1 answer
    What is the possible documentation available for R package? For example I try to understand sp package. In addition to help(sp), what are the other functions for searching through help and documentation? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
969 views
1 answer
    I have following type of count data. A 450 B 1800 A and B both 230 I want to develop a colorful (possibly semi-transparency at intersections) like the ... drawn in PowerPoint, and it is not to scale. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
904 views
1 answer
    I wonder if one could simply use LaTeX ewpage command in R markdown v2 in a different way than this: ```{r, results='asis', echo=FALSE} cat( ... true toc_depth: 3 number_sections: true keep_tex: true --- See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    Here is my R code. The functions are defined as: f <- function(x, T) { 10 * sin(0.3 * x) * sin(1.3 * x ^ 2) + 0.001 ... arguments a good and safe practice or it may cause some potential trouble? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
946 views
1 answer
    There are very nifty ways of subsetting xts objects. For example, one can get all the data for all years, months, days but being strictly between 9 ... and years? Do any other subsetting tricks exist? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.2k views
1 answer
    I realize that dplyr v3.0 allows you to join on different variables: left_join(x, y, by = c("a" = "b") will match x.a to y.b However, is it possible to ... concatenation of [x.a and x.c] to [y.b and y.d] See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
708 views
1 answer
    I want to perform a stepwise linear Regression using p-values as a selection criterion, e.g.: at each step dropping variables that have the highest ... if there is an already implemented version of this. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I would like to reproduce the plot immediately below by using ggplot2. I can come close, but cannot remove the top and right borders. Below I present ... none) + opts( panel.border = theme_L_border()) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    This simple code (and all my scripts from this morning) has started giving me an off center title in ggplot2: Ubuntu version: 16.04 R studio version: ... bill") + ggtitle("Average bill for 2 people") See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
863 views
1 answer
    I'm learning R recently and confused by two function: lapplyand do.call. It seems that they're just similar to map function in Lisp. But why are there ... Why doesn't R just use a function called map? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have two data.frames that I want to merge together. The first is: datess <- seq(as.Date('2005-01-01'), as.Date('2009-12-31'), 'days') sample<- data ... abc 1 2005-01-03 abc 1 {cont} 2009-12-31 thanks 2 See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
894 views
1 answer
    > x <- 1.00042589212565 > x [1] 1.000426 If I wanted to print the exact value of x, how would I do it? Sorry if this is a dumb question. I ... I get are articles about how to round. Thank you in advance! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
814 views
1 answer
    In R software a <- 123456789123456789123456789 sprintf("%27f",a) #[1] "123456789123456791337762816.000000" I got the wrong answer. I want exact a value. Why is the system showing the wrong value of a? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
966 views
1 answer
    I know we can dynamically add column names when creating columns by reference (using :=), as described e.g. here: Dynamic column names in data.table. However, ... unexpected '=' in "test_dtb[ , list((m) = See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
852 views
1 answer
    For a publication I need to add a second y-axis to an existing plot. I've come across a means of how to do this (https://rpubs.com/kohske/ ... r") # Draw it grid.newpage() grid.draw(g1) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I am trying to change the value of a number of columns at once using a lookup table. They all use the same lookup table. I know how to do ... function like LETTERS to solve things. Thank you in advance! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
860 views
1 answer
    Can anyone explain to me why the following example occurs? #Create simple dataframe assign( "df" , data.frame( P = runif(5) , Q = runif(5) , R ... return the names (or NULL) of those objects. Thanks! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
921 views
1 answer
    As part of my dataset, one of the columns is a series of 24-digit numbers. Example: bigonumber <- 429382748394831049284934 When I import it using either data. ... I don't get to dictate that to them.) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.1k views
1 answer
    I have a vector of date objects (yyyy-mm-dd) and I want to determine if any of them are on weekend or not. Is there a function that can determine this ... 1) x[lubridate::wday(x) %in% c(1, 7)] See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
To see more, click for the full list of questions or popular tags.
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...