Re: [R] Plot MArginal distribution in the correct place

2017-06-07 Thread Pedro páramo
Please, I'm trying to put the right plot higher and centered on the left values but I don't achive. I would appreciate so much your help El 6 jun. 2017 22:37, "Pedro páramo" escribió: > Hi all, > > I have this code, but the marginal distribution plot doesn´t appear > aligned with the left plot.

[R] Errors running spdplyr example

2017-06-07 Thread Shige Song
Dear All, When I tried to run the following code (taken from the *spdplyr* package vignettes): library(spdplyr) library(maptools) data(wrld_simpl) worldcorner <- wrld_simpl %>% mutate(lon = coordinates(wrld_simpl)[,1], lat = coordinates(wrld_simpl)[,2]) %>% filter(lat < -20, lon > 60) %>%

[R] Operating on RC in a list

2017-06-07 Thread Mohan.Radhakrishnan
Hi, I have a hierarchy of such classes. Subject has a list of measurements. Let assume I have a list of such 'Subject' RC's. Can I use dplyr to navigate from Subject to the list of measurement RC's and filter and group data ? dplyr should be able to call the methods on these RC's to operate on

[R] Getting forecast values using DCC GARCH fit

2017-06-07 Thread Dhivya Narayanasamy
Hi, I am completely new to GARCH models and trying to fit a multivariate time series model using DCC GARCH model and forecast it. The data looks like this: > head(datax) x vibration_x Speed 1 2017-05-16 17:53:00 -0.132 421.4189 2 2017-05-16 17:54:00 -0.296 129

Re: [R] Plot MArginal distribution in the correct place

2017-06-07 Thread Jim Lemon
Hi Pedro, As a one-off, you just shove the coordinates around a bit: par(mar=c(11,0,6,6)) barplot(fhist$counts,axes=FALSE, space=0,horiz=TRUE,col="lightgray", ylim=c(0,24)) However, I don't think that this plot illustrates quite what you think it does. Jim On Wed, Jun 7, 2017 at 4:01 PM, Pedr

Re: [R] Errors running spdplyr example

2017-06-07 Thread Michael Sumner
On Wed, 7 Jun 2017 at 17:29 Shige Song wrote: > Dear All, > > When I tried to run the following code (taken from the *spdplyr* package > vignettes): > > library(spdplyr) > library(maptools) > data(wrld_simpl) > > worldcorner <- wrld_simpl %>% > mutate(lon = coordinates(wrld_simpl)[,1], lat = >

Re: [R] Determining which.max() within groups

2017-06-07 Thread David L Carlson
If you want the Julian date, you could use Bert's index on the original data frame: Daily[out$Q, ] Date wyrQ 4 1911-04-04 1990 5.097032 6 1911-04-06 1991 6.569508 9 1911-04-09 1992 4.445745 15 1911-04-16 1993 3.001586 18 1911-04-28 1994 3.369705 Another way to get that index

[R] An R question

2017-06-07 Thread li li
Hi all, In checking my R codes, I encountered the following problem. Is there a way to fix this? I tried to specify options(digits=). I did not fix the problem. Thanks so much for your help! Hanna > cdf(pmass)[2,2]==pcum[2,2][1] FALSE> cdf(pmass)[2,2][1] 0.758> > pcum[2,2][1] 0.75

Re: [R] An R question

2017-06-07 Thread Rui Barradas
Hello, See FAQ 7.31 And try ?all.equal. Hope this helps, Rui Barradas Em 07-06-2017 15:32, li li escreveu: Hi all, In checking my R codes, I encountered the following problem. Is there a way to fix this? I tried to specify options(digits=). I did not fix the problem. Thanks so much for

[R] purrr::pmap does not work

2017-06-07 Thread G . Maubach
Hi All, I try to do a scatterplot for a bunch of variables. I plot a dependent variable against a bunch of independent variables: -- cut -- graphics::plot( v01_r01 ~ v08_01_up11, data = dataset, xlab = "Dependent", ylab = "Independent #1" ) -- cut -- It is tedious to repeat the stateme

Re: [R] An R question

2017-06-07 Thread Ivan Calandra
Hi, Check the FAQ 7.31 https://cran.rstudio.com/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f And read the posting guide too... https://www.r-project.org/posting-guide.html HTH, Ivan -- Dr. Ivan Calandra TraCEr, Laboratory for Traceology and Controlled Experiments MON

Re: [R] An R question

2017-06-07 Thread li li
Thank you! 2017-06-07 10:38 GMT-04:00 Ivan Calandra : > Hi, > > Check the FAQ 7.31 > https://cran.rstudio.com/doc/FAQ/R-FAQ.html#Why-doesn_0027t- > R-think-these-numbers-are-equal_003f > > And read the posting guide too... > https://www.r-project.org/posting-guide.html > > HTH, > Ivan > > -- > Dr

[R] Adding zeros in each dimension of an array

2017-06-07 Thread li li
For a data frame, we can add an additional row or column easily. For example, we can add an additional row of zero and an additional row of column as follows. Is there an easy and similar way to add zeros in each dimension? For example, for array(1:12, dim=c(2,2,3))? Thanks for your help!! Han

Re: [R] Determining which.max() within groups

2017-06-07 Thread Jeff Newmiller
Aggregate can do both which.max and group length calculations, but the result ends up as a matrix inside the data frame, which I find cumbersome to work with. Daily <- read.table( text = " Date wyrQ 1911-04-01 1990 4.530695 1911-04-02 1990 4.700596 1911-04-03 1990 4.898814 1911-04-

Re: [R] Adding zeros in each dimension of an array

2017-06-07 Thread David Winsemius
> On Jun 7, 2017, at 8:33 AM, li li wrote: > > For a data frame, we can add an additional row or column easily. For > example, we can add an additional row of zero and an additional row of > column as follows. > > Is there an easy and similar way to add zeros in each dimension? For > example, f

Re: [R] Adding zeros in each dimension of an array

2017-06-07 Thread Jeff Newmiller
Please read https://www.lifewire.com/how-to-send-a-message-in-plain-text-from-gmail-1171963 Re your question: easy is in the eye of the beholder. a <- array( 1:12, dim = c( 2, 2, 3 ) ) b <- array( 0, dim = dim( a ) + 1 ) b[ 1:2, 1:2, 1:3 ] <- a If you want to do a lot of this, it could be wrapp

[R] Problem related to rowSums

2017-06-07 Thread Yogesh Gupta
Hi... I have a dataframe with n columns and n rows. I need to find how many rows contains zero raw read count across all column. Thanks -- *Yogesh Gupta* *Postdoctoral Researcher* *Department of Biological Science* *Seoul National University* *Seoul, South Korea* [[alternative HTML ver

[R] error while opening vignette DESeq2

2017-06-07 Thread Yogesh Gupta
Hi , I am trying to open vignette DESeq2 but getting below error: > vignette("DESeq2") > START /usr/bin/evince "/usr/lib64/R/library/DESeq2/doc/DESeq2.pdf" Cannot parse arguments: Cannot open display: xdg-open: no method available for opening '/usr/lib64/R/library/DESeq2/doc/DESeq2.pdf' -- *Yog

Re: [R] Adding zeros in each dimension of an array

2017-06-07 Thread li li
Thanks! That is the method I am using now but I was checking whether there is a simpler option. I will look into the abind package too. Hanna 2017-06-07 12:25 GMT-04:00 Jeff Newmiller : > Please read > https://www.lifewire.com/how-to-send-a-message-in-plain-text > -from-gmail-1171963 > > Re yo

Re: [R] purrr::pmap does not work

2017-06-07 Thread Jeff Newmiller
A) You are not making reproducible examples. Try out the package "reprex" to help you recognize when you are forgetting details. B) I suspect your problem is not understanding formulas. The first thing that comes to my mind is using a version of the plot function that does not use formulas for

Re: [R] error while opening vignette DESeq2

2017-06-07 Thread Jeff Newmiller
Sounds like your operating system does not have a default PDF viewer, or does not have X-windows installed. On Wed, 7 Jun 2017, Yogesh Gupta wrote: Hi , I am trying to open vignette DESeq2 but getting below error: vignette("DESeq2") START /usr/bin/evince "/usr/lib64/R/library/DESeq2/doc/DES

Re: [R] Problem related to rowSums

2017-06-07 Thread Jeff Newmiller
I don't understand "zero raw read count across all column". Please read the Posting Guide (mentioned below) which points out that this is a plain text mailing list (your email gets damaged to varying degrees if you don't set your sending format to plain text), and you need to make your example

[R] Another way to count TRUE

2017-06-07 Thread Suharto Anggono Suharto Anggono via R-help
To get the number of TRUE in logical vector 'x', tabulate(x, 1) can be used. Actually, it gives count of 1, but TRUE as integer is 1. Since R 3.4.0, it gives a correct answer, too, when the count is 2^31 or more. __ R-help@r-project.org mailing list --

Re: [R] Another way to count TRUE

2017-06-07 Thread Bert Gunter
Bad idea! In R3.3.3 it doesn't even work: > y1 <- tabulate(x,1) Error in tabulate(x, 1) : 'bin' must be numeric or a factor ## This does: > y1 <- tabulate(as.integer(x),1) But it's more inefficient than just using sum(), even discounting the as.integer() conversion: > y1 <- tabulate(as.intege

Re: [R] Determining which.max() within groups

2017-06-07 Thread Charles C. Berry
On Tue, 6 Jun 2017, Morway, Eric wrote: Using the dataset below, I got close to what I'm after, but not quite all the way there. Any suggestions appreciated: Daily <- read.table(textConnection(" Date wyrQ 1911-04-01 1990 4.530695 1911-04-02 1990 4.700596 1911-04-03 1990 4.898814 1

[R] Time series axis breaks

2017-06-07 Thread Felipe Carrillo via R-help
I hope this is the appropriate list for this type of question Consider the dataset below:I have a column DOC with values from 3 to 101and those are the values that I want to show on my x axis, howeverI only get 3, 3.1, 3.2 and so on. I tried to change those values with xlim(3, 101) but I getthe

Re: [R] purrr::pmap does not work

2017-06-07 Thread MacQueen, Don
You might try matplot() example: x <- matrix(rnorm(30), ncol=3) ## plot a dependent variable (1:10) against a bunch of independent variables (the three columns of x) matplot(x , 1:10, type='b') ## or a bunch of dependent variables (the three columns of x) against an independent variable (1:

Re: [R] [FORGED] Problem related to rowSums

2017-06-07 Thread Rolf Turner
On 07/06/17 21:08, Yogesh Gupta wrote: Hi... I have a dataframe with n columns and n rows. I need to find how many rows contains zero raw read count across all column. (1) You should probably have a *matrix*, not a data frame. (2) Have you ever heard of the idea of providing a *reproducible

[R] rmarkdown and font size

2017-06-07 Thread MacQueen, Don
Suppose I have a file (named "tmp.rmd") containing: --- title: Test --- ```{r example, echo=FALSE, results='asis'} tmp <- data.frame(a=1:5, b=letters[1:5]) print( knitr::kable(tmp, row.names=FALSE)) ``` And I render it with: rmarkdown::render('tmp.rmd', output_format=c('html_document','pdf_d

Re: [R] Another way to count TRUE

2017-06-07 Thread Suharto Anggono Suharto Anggono via R-help
Ah, yes, of course. tabulate(x, 1) doesn't work, too, in R 3.4.0. Sorry, I didn't actually try. I thought of an alternative when TRUE count is 2^31 or more. sum(x) returns NA with a warning. sum(as.numeric(x)) works, but requires a quite large memory.

[R] Matrix multiplication

2017-06-07 Thread Steven Yen
I need to have all elements of a matrix multiplied by a weight before being post-multiplied by itself, as shown in the forst block of codes below. I can also multiply the matrix by the square root of the weight and then take the outer product. Actually, what I need is this. Denote each row of t

[R] time series x axis labels

2017-06-07 Thread Felipe Carrillo via R-help
I hope this is the appropriate list for this type of question Consider the dataset below:I have a column DOC with values from 3 to 101and those are the values that I want to show on my x axis, howeverI only get 3, 3.1, 3.2 and so on. I tried to change those values with xlim(3, 101) but I getthe

Re: [R] Matrix multiplication

2017-06-07 Thread Jeff Newmiller
Is this a question? You seem to have three possible calculations, have already implemented two of them (?) and it is unclear (to me) what you think the right answer for any of them is supposed to be. -- Sent from my phone. Please excuse my brevity. On June 7, 2017 8:50:55 PM PDT, Steven Yen w

Re: [R] Matrix multiplication

2017-06-07 Thread Steven Yen
OK Thanks. Your response made me think. Here (the last line) is what I need: set.seed(76543211) w<-1:10; w a<-matrix(rpois(20,2),nrow=10); a t(w*a)%*%a On 6/8/2017 12:09 PM, Jeff Newmiller wrote: > Is this a question? You seem to have three possible calculations, have > already implemented two o

Re: [R] Matrix multiplication

2017-06-07 Thread Jeff Newmiller
Fine, except that you already seen to have a very compact solution if that really is what you are looking for. What am I missing? -- Sent from my phone. Please excuse my brevity. On June 7, 2017 9:16:48 PM PDT, Steven Yen wrote: >OK Thanks. Your response made me think. Here (the last line) is

[R] stepAIC() that can use new extractAIC() function implementing AICc

2017-06-07 Thread Marc Girondot via R-help
I would like test AICc as a criteria for model selection for a glm using stepAIC() from MASS package. Based on various information available in WEB, stepAIC() use extractAIC() to get the criteria used for model selection. I have created a new extractAIC() function (and extractAIC.glm() and e