Re: [R] A question on Statistics regarding regression

2024-08-24 Thread Ben Bolker
  This is probably better for Cross Validated [https://stats.stackexchange.com]. Surprisingly, I can't quickly find an answered question on this topic. My "tl;dr" answer would be: "inflated" relative to what? Having an unbalanced sample certainly decreases the *power* of an analysis, but there'

Re: [R] A question on Statistics regarding regression

2024-08-24 Thread Jeff Newmiller via R-help
you say you asked elsewhere, but so many hits come up when I just search for "unbalanced sample size" your justification for not following the posting guide does not seem honest. I also recall that various discussions of statistical power address this in basic statistics. On August 24, 2024 1

[R] A question on Statistics regarding regression

2024-08-24 Thread Christofer Bogaso
Hi, I have asked this question elsewhere however failed to get any response, so hoping to get some insight from experts and statisticians here. Let say we are fitting a regression equation where one explanatory variable is categorical with 2 categories. However in the sample, one category has 95%

Re: [R] A question related to extracting peptides from indels for mouse

2022-11-17 Thread Bert Gunter
Probably not here. Better here: https://bioconductor.org/help/ -- Bert On Thu, Nov 17, 2022 at 6:43 AM Li, Aiguo (NIH/NCI) [E] via R-help < r-help@r-project.org> wrote: > Dear all, > > I need to extract peptides from a long list of indels of mouse for > neoantigen analysis. Does anyone know a t

[R] A question related to extracting peptides from indels for mouse

2022-11-17 Thread Li, Aiguo (NIH/NCI) [E] via R-help
Dear all, I need to extract peptides from a long list of indels of mouse for neoantigen analysis. Does anyone know a tool that will do it? Thanks, Anna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCR

Re: [R] A question about Spatial in Kriging

2022-03-25 Thread Richard O'Keefe
Thank you for the reference to "Spatial Predictive Modeling with R". I look forward to reading it. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] A question about Spatial in Kriging

2022-03-25 Thread Richard O'Keefe
Start with a good book like "Applied Spatial Data Analysis with R". If you want to do spatial data analysis, then you are going to need measurements at lots of different places in space. On Thu, 24 Mar 2022 at 23:14, Hasliza Rusmili wrote: > Thank you very much. I will ask the question there. >

Re: [R] A question about Spatial in Kriging

2022-03-24 Thread Hasliza Rusmili
Thank you very much. I will ask the question there. Siti Hasliza On Mon, 21 Mar 2022, 03:28 Bert Gunter, wrote: > You should post this on the r-sig-geo list rather than here: > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > That's where expertise on spatial data analysis is likely to reside.

Re: [R] A question of data frame filter based on another one

2022-02-18 Thread Rui Barradas
Hello, Sorry, typo. It's rowSums(y), not x. x[rowSums(y) > 0L, ] Rui Barradas Às 20:30 de 18/02/2022, Rui Barradas escreveu: Hello, Use ?rowSums and compare its result to 0. You want the sums greater than zero. x <- "   id  g 1  1 21 2  3 52 3  2 43 4  4 94 5  5 35" y <- " id g 1  1 1 2

Re: [R] A question of data frame filter based on another one

2022-02-18 Thread Eric Berger
x[apply(y,MAR=1,sum) > 0,] On Fri, Feb 18, 2022 at 10:24 PM Li, Aiguo (NIH/NCI) [E] via R-help < r-help@r-project.org> wrote: > I have tow dataframes as below: > > x > id g > 1 1 21 > 2 3 52 > 3 2 43 > 4 4 94 > 5 5 35 > > > y > id g > 1 1 1 > 2 0 0 > 3 0 1 > 4 1 0 > 5 1 0 > > Resu

Re: [R] A question regarding 749 R[21525:2855847] Warning

2021-01-18 Thread Patrick (Malone Quantitative)
Checked R-Sig-Mac, which I should have done before posting, then leaving this alone on R-help. Seems to be a solved problem: * The Mac R GUI: "R-GUI-7903-4.0-high-sierra-Debug" works fine. Those warnings disappeared with this R GUI (with a 16-inch MacBook Pro 2019, Big Sur 11.0.1 operating

Re: [R] A question regarding 749 R[21525:2855847] Warning

2021-01-18 Thread Patrick (Malone Quantitative)
The current version of Big Sur is 11.1, with 11.2 in public beta. So this may have been fixed. Maedeh, are you able to check? On Sun, Jan 17, 2021 at 4:10 PM Maedeh Kamali wrote: > > Dear Gregory Coast, > > Thanks for your reply. > I searched so much regarding how to fix this problem. Unfortunate

Re: [R] A question regarding 749 R[21525:2855847] Warning

2021-01-17 Thread Maedeh Kamali
Dear Gregory Coast, Thanks for your reply. I searched so much regarding how to fix this problem. Unfortunately, it stems from Bug Sur 11.0.1 and we should wait for its new version in which the problem has been fixed. Best, Maedeh Kamali On Sat, 16 Jan 2021, 08:18 Gregory Coats, wrote: > I repo

Re: [R] A question regarding 749 R[21525:2855847] Warning

2021-01-15 Thread Gregory Coats via R-help
I reported this behavior on Thu Jan 7, 2021. You did nothing wrong. No fix has been issued. This evening, I upgraded from R 4.0.2 to the Duke University R 4.0.3 for Apple Mac. Now all I can get from R 4.0.3 is this red error message (that means nothing to me). Is there an easy fix? Greg 2021-01

[R] A question regarding 749 R[21525:2855847] Warning

2021-01-15 Thread maedeh kamali
Dear Sir/Madam, After installing R package version 4.0.3 and launching the R Console for the first time, below warning message appeared: 021-01-15 11:52:28.749 R[21525:2855847] Warning: Expected min height of view: () to be less than or equal to 30 but got a height of 32.00. This error wil

Re: [R] A question on substitute()

2020-12-13 Thread Bert Gunter
Please disregard my previous post. My understanding is correct, and the behavior is **AS DOCUMENTED**. I failed to read the docs carefully. Mea Culpa. Best, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley

[R] A question on substitute()

2020-12-13 Thread Bert Gunter
I would appreciate any help in correcting my misunderstanding of the following: > substitute(quote(x+a), env = list(a=5)) quote(x + 5) ## as expected > substitute(quote(x+a), env = list2env(list(a=5))) quote(x + 5) ## as expected > ### BUT > .GlobalEnv$a [1] 5 > substitute(quote(x+a), env = .Gl

Re: [R] A question about optim function in R

2020-07-26 Thread Rasmus Liland
Dear Zixuan, On 2020-07-26 07:36 -0700, Jeff Newmiller wrote: > On July 26, 2020 7:33:32 AM PDT, Zixuan Qi wrote: > > Hi, > > > > I encounter a problem in R. My program is as follows. > > lower <- c(-Inf, -Inf, -Inf, -Inf, 0, 0, 0, -1, -1, -1) > > upper <- c(Inf, Inf, Inf, Inf, Inf, Inf, Inf, 1,

Re: [R] A question about optim function in R

2020-07-26 Thread J C Nash
For this and the nlminb posting, a reproducible example would be useful. The optimx package (I am maintainer) would make your life easier in that it wraps nlminb and optim() and other solvers, so you can use a consistent call. Also you can compare several methods with opm(), but do NOT use this fo

[R] A question about nlminb function

2020-07-26 Thread Zixuan Qi
Hi, I use the function nlminb to maximize a function and got convergence with the message false-convergence. I know the reason may be the gradient $B"`(Bf(x) may be computed incorrectly, the other stopping tolerances may be too tight, or either f or $B"`(Bf may be discontinuous near the cur

Re: [R] A question about optim function in R

2020-07-26 Thread Jeff Newmiller
This is not reproducible. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette) On July 26, 2020 7:33:32 AM PDT, Zixuan Qi w

[R] A question about optim function in R

2020-07-26 Thread Zixuan Qi
Hi, I encounter a problem in R. My program is as follows. lower <- c(-Inf,-Inf,-Inf,-Inf,0,0,0,-1,-1,-1) upper <- c(Inf,Inf,Inf,Inf,Inf,Inf,Inf,1,1,1) out <- optim(parm,logLik,method='L-BFGS-B',lower=lower,upper=upper,hessian=hessian) As you can see, I have restricted parameter[5], parameter[6]

Re: [R] A Question about MLE in R

2020-07-24 Thread Andrew Robinson
Hi Ravi, that's an interesting claim and N-M. Can you provide any reading matter to support it? Cheers, Andrew -- Andrew Robinson Director, CEBRA and Professor of Biosecurity, School/s of BioSciences and Mathematics & Statistics University of Melbourne, VIC 3010 Australia Tel: (+61) 0403 138

Re: [R] A Question about MLE in R

2020-07-24 Thread Andrew Robinson
Hi John, I wonder if you can suggest some reading material on that topic? A cursory search of the net doesn't uncover anything obvious. Andrew -- Andrew Robinson Director, CEBRA and Professor of Biosecurity, School/s of BioSciences and Mathematics & Statistics University of Melbourne, VIC 3010

Re: [R] A Question about MLE in R

2020-07-24 Thread Ravi Varadhan
I agree with John that SANN should be removed from optim. More importantly, the default choice of optimizer in optim should be changed from "Nelder-Mead" to "BFGS." Nelder-Mead is a bad choice for the most commonly encountered optimization problems in statistics. I really do not see a good

Re: [R] A Question about MLE in R

2020-07-22 Thread J C Nash
SANN is almost NEVER the tool to use. I've given up trying to get it removed from optim(), and will soon give up on telling folk not to use it. JN On 2020-07-22 3:06 a.m., Zixuan Qi wrote: > Hi, > > I encounter a problem. I use optim() function in R to estimate likelihood > function and the met

Re: [R] A Question about MLE in R

2020-07-22 Thread peter dalgaard
Simulated annealing is a probabilistic method and will do things like that. You should probably read an introduction to the method, e.g. the Wikipedia page. Not too unlikely, you really want to use one of the other methods in optim() (or better still optimr from the optimx package). (I take it

[R] A Question about MLE in R

2020-07-22 Thread Zixuan Qi
Hi, I encounter a problem. I use optim() function in R to estimate likelihood function and the method is SANN in the optim function. out <- optim(parm,logLik,method='SANN',hessian=T,control=list(maxit=500)) However, I find that each time I run the program, I will get different values of param

Re: [R] a question of etiquette

2020-06-01 Thread Jeff Newmiller
lease call phone number above prior to faxing) >> >> >> From: R-help on behalf of Adelchi >Azzalini >> Sent: Monday, June 1, 2020 3:17 PM >> To: Michael Dewey >> Cc: r-help@r-project.org >> Subject: Re: [R] a question of etiquette >> >> >&g

Re: [R] a question of etiquette

2020-06-01 Thread Adelchi Azzalini
4 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > > From: R-help on behalf of Adelchi Azzalini > > Sent: Monday, June 1, 2020 3:17 PM > To: Michael Dewey > Cc: r-help@r-project.org > Subject: Re: [R] a question of e

Re: [R] a question of etiquette

2020-06-01 Thread Sorkin, John
/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) From: R-help on behalf of Adelchi Azzalini Sent: Monday, June 1, 2020 3:17 PM To: Michael Dewey Cc: r-help@r-project.org Subject: Re: [R] a

Re: [R] a question of etiquette

2020-06-01 Thread Adelchi Azzalini
> On 1 Jun 2020, at 19:37, Michael Dewey wrote: > > You might get better answers on the list dedicated to package development > r-pkg-devel This is a good suggestion. Thanks, Michael. Some initial search of that list did not lead to any indication, but I will have a second look. Best re

Re: [R] a question of etiquette

2020-06-01 Thread Michael Dewey
You might get better answers on the list dedicated to package development r-pkg-devel This may have already been discussed there so a quick look at the archive might also help you. On 01/06/2020 17:34, Adelchi Azzalini wrote: The new version of a package which I maintain will include a new f

[R] a question of etiquette

2020-06-01 Thread Adelchi Azzalini
The new version of a package which I maintain will include a new function which I have ported to R from Matlab. The documentation of this R function indicates the authors of the original Matlab code, reference to their paper, URL of the source code. Question: is this adequate, or should I includ

Re: [R] A question on regular expression

2019-09-13 Thread Jeff Newmiller
Regular expressions are in much more widespread use than merely R... and there are correspondingly more resources for learning than just R-help. Please do make use of them. Here are a couple that googling "regex character set carat" found: https://www.regular-expressions.info/charclass.html htt

Re: [R] A question on regular expression

2019-09-13 Thread Christofer Bogaso
A quick question. Could you please explain the -- [^}]* -- part in finding the pattern? On Fri, Sep 13, 2019 at 12:19 AM Bert Gunter wrote: > > > You can't use the same regex for str_extract_all as I used for sub (or gsub, > which is what is required here)! If you do this sort of thing a lot, y

Re: [R] A question on regular expression

2019-09-12 Thread Christofer Bogaso
Awesome, thanks! On Fri, Sep 13, 2019 at 12:19 AM Bert Gunter wrote: > > > You can't use the same regex for str_extract_all as I used for sub (or gsub, > which is what is required here)! If you do this sort of thing a lot, you > *must* learn more about regex's. > > Anyway, this will do what you

Re: [R] A question on regular expression

2019-09-12 Thread Bert Gunter
You can't use the same regex for str_extract_all as I used for sub (or gsub, which is what is required here)! If you do this sort of thing a lot, you *must* learn more about regex's. Anyway, this will do what you want I think: z <- paste("ab{cd$ }ed", "ab{cad$ }ed", collapse = " ") ## just for r

Re: [R] A question on regular expression

2019-09-12 Thread Christofer Bogaso
Thanks Bert, This works, but if in my text there are more than one patterns then fails to generate desired result. library(stringr) str_extract_all(paste("ab{cd$ }ed", "ab{cad$ }ed", collapse = " "), ".*(\\{.*\\}).*") This generates below - [[1]] [1] "ab{cd$ }ed ab{cad$ }ed" I was expecting I

Re: [R] A question on regular expression

2019-09-12 Thread Bert Gunter
> sub(".*(\\{.*\\}).*", "\\1","ab{cd$ }ed") [1] "{cd$ }" Use ".+" instead of ".*" within the {} if you don't want to return empty {}'s. You might wish to use the stringr package for string matching and manipulation, as it provides a more user friendly and consistent interface to these tasks. Be

[R] A question on regular expression

2019-09-12 Thread Christofer Bogaso
Hi, I am wondering on what is the correct way to select a pattern which goes as - {"(any character with any length)"} The expressions " {" " and " "} " both are included in the pattern. For example, the lookup of the above pattern in the text " {"asaf455%"}57573blabla " will result in {"asaf455

Re: [R] A question on generating Error message upon Timeout

2019-05-11 Thread Rui Barradas
Hello, This solution works but when I've tried it, I realized it depends on the locale. In mine, pt_PT.UTF-8, the error message is in Portuguese and it failed. So I have two suggestions. 1) grep "Sys.sleep" in attr(n_Try, "condition") 2) not related but instead of length(grep(.)) > 0, logical

Re: [R] A question on generating Error message upon Timeout

2019-05-11 Thread Eric Berger
Hi Christofer, You have a number of misunderstandings. The first thing you could have tried in order to figure out what was going on was to remove the 'silent=TRUE' from the call to try(). This would then give you extra information, specifically that there was a timeout. The exact message that gets

[R] A question on generating Error message upon Timeout

2019-05-09 Thread Christofer Bogaso
Hi, I have created a function called myFn() which should be acting as below: 1. If function takes too long, then it will timeout and a specific message will be displayed 2. This function may generate error on its own, so if it evaluates before that specific time and fails then another specific me

[R] A Question from kamila package

2019-04-29 Thread mahboobe akhlaghi
Hello. I have a question from kamila package. I run this package on my data and the database is on SQL server. now, I have an error that I don't know what should I do. kamrespresc<-kamila(conVarsPresc,catVarsFacPresc,numClust=3,numInit=10) Error in matrix(data = log(gtools::rdirichlet(n = numClust,

Re: [R] A question on Statistics

2018-07-01 Thread Christofer Bogaso
I derive posting guide from https://www.r-project.org/posting-guide.html I am imagining a distribution where mean is zero but there are few large observations in the positive side which are not very frequent. On Sun, Jul 1, 2018 at 8:29 PM Bert Gunter wrote: > From the posting guide: > > "*R-he

Re: [R] A question on Statistics

2018-07-01 Thread Bert Gunter
>From the posting guide: "*R-help* is intended to be comprehensible to people who want to use R to solve problems but who are not necessarily interested in or knowledgeable about programming." This says to me that R-help is for general questions about R programming, not statistics, though I grant

Re: [R] A question on Statistics

2018-07-01 Thread Christofer Bogaso
Hi, I could post in StackExchange for sure, however I dont think R-help posting guide discourage asking a question about Statistics, atleast formally. I could further clarify if my question is not elaborate enough. And many apologies if it is very trivial - however still I am looking for 2nd opin

Re: [R] A question on Statistics

2018-06-30 Thread Hasan Diwan
Christofer, On Sat, 30 Jun 2018 at 12:54, Jeff Newmiller wrote: > > You should use Stack Exchange for questions about statistics. Specifically, https://stats.stackexchange.com/ -- H -- OpenPGP: https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1 If you wish to request my time,

Re: [R] A question on Statistics

2018-06-30 Thread Jeff Newmiller
You should use Stack Exchange for questions about statistics. You should also think a bit before you post, regardless of where. You are the one who described this as a highly asymmetric distribution, and didn't say anything about it being centered at zero. You already answered your own questio

[R] A question on Statistics

2018-06-30 Thread Christofer Bogaso
Hi, I have a quick question on Statistical distribution as follows, hoping Statisticians here would give me very insightful feedback. Say, I have a large sample from a highly asymmetric distribution ranging from -Inf to +Inf. Now I wish to calculate sample X1 and X2 within which middle 70% probab

Re: [R] a question about R script : "Can only modify plain character vectors."

2018-05-08 Thread Eric Berger
Can you create a small script that reproduces the problem? If you can, then please post it to the mailing list. On Tue, May 8, 2018 at 4:24 PM, Bogdan Tanasa wrote: > Dear all, > > would appreciate a suggestion about the following situation : I am running > a script in R, and shall i execute it

[R] a question about R script : "Can only modify plain character vectors."

2018-05-08 Thread Bogdan Tanasa
Dear all, would appreciate a suggestion about the following situation : I am running a script in R, and shall i execute it in the terminal, step by step, it works fine. however, if i do source ("script.R"), it does not complete and I am getting the error : "Can only modify plain character vector

Re: [R] A question about for loop

2017-08-17 Thread Boris Steipe
There are many ways to get the output you want, so your question is ill defined. But it is easy to see where your code goes wrong. And it should be easy for you to fix it. If you subset a vector with the '[' operator, this is like putting a vector of indices "into" the square brackets. So, to d

[R] A question about for loop

2017-08-17 Thread Moohwan Kim
Dear R users, I have the following codes: zeta <- rep(1,8) n <- 7 for (i in 1:2){ beta <- zeta[1:n+(i-1)*(n+1)] print(beta) parm <- zeta[i*(n+1)] print(parm) } ### The output is as follows: [1] 1 1 1 1 1 1 1 [1] 1 [1] NA NA NA NA NA NA NA [1] NA ### The outcome

Re: [R] A question on modeling brain growth using GAM

2017-04-07 Thread Leon Lee
Simon I wonder whether I can take advantage of this thread and ask you another related question. Now, I want to get the 95%CI of the fit and their derivatives as well. For the original fitted curves, It is straightforward as the option "type=terms" can be used to get the CI for the fixed effect. N

Re: [R] A question on modeling brain growth using GAM

2017-04-07 Thread Leon Lee
Hi, Simon Thank you for your explanation! I followed the instructions and successfully get the predicted values with both fixed and random effects incorporated: pred.new=predict.gam(gamm1$gam,newdata,type="response"). Also, what I meant to say was "plot(gamm1$gam, pages=1)" for left and right fig

Re: [R] A question on modeling brain growth using GAM

2017-04-06 Thread Simon Wood
> > gamObj=gam(brainVolume~ s(correctedAge) + s(subjIndexF, bs="re") + > s(subjIndexF, correctedAge, bs="re"), method="REML", data=mydata), > where subjIndexF is a factor for each subject. I was thrown an error > saying "more coefficients than data". > --- I'm not sure exactly how many scans a

Re: [R] A question on modeling brain growth using GAM

2017-04-06 Thread Simon Wood
If 'subjIndexF' is a factor for subject, then s(subjIndexF, bs="re") will produce a random effect for subject. i.e. each subject will be given its own random intercept term, which is a way that repeated measures data like this are often handled. The reason for the s(subjIndexF, bs="re") syntax

Re: [R] A question on modeling brain growth using GAM

2017-03-30 Thread David Winsemius
> On Mar 30, 2017, at 6:56 AM, Leon Lee wrote: > > David > > Thank you for your reply. I apologize if I posted in the wrong forum, as I > really couldn't decide which forum is the best place for my question and I > saw similar questions asked before in this forum. > > I agree that a sample

Re: [R] A question on modeling brain growth using GAM

2017-03-30 Thread Leon Lee
David Thank you for your reply. I apologize if I posted in the wrong forum, as I really couldn't decide which forum is the best place for my question and I saw similar questions asked before in this forum. I agree that a sample of ~30 subjects (70 scans in total), the model can be too complicated

Re: [R] A question on modeling brain growth using GAM

2017-03-28 Thread David Winsemius
> On Mar 28, 2017, at 9:32 AM, Leon Lee wrote: > > Hi, R experts > > I am new to R & GAM toolbox and would like to get inputs from you all on my > models. The question I have is as follows: > I have 30 subjects with each subject being scanned from one to three times > in the first year of life.

[R] A question on modeling brain growth using GAM

2017-03-28 Thread Leon Lee
Hi, R experts I am new to R & GAM toolbox and would like to get inputs from you all on my models. The question I have is as follows: I have 30 subjects with each subject being scanned from one to three times in the first year of life. The brain volume from each scan was measured. The scan time was

Re: [R] A question on data frame

2016-08-24 Thread David Winsemius
> On Aug 24, 2016, at 11:48 AM, Christofer Bogaso > wrote: > > Hello again, > > Let say I have a data.frame which I call as reference data frame : > > Ref = data.frame(c("a", "d", "c", "e", "f", "x"), matrix(NA, 6, 5)) > colnames(Ref) = c("a1", "a2", "a3", "a4", "a5", "a6") > Ref > > Now I h

[R] A question on data frame

2016-08-24 Thread Christofer Bogaso
Hello again, Let say I have a data.frame which I call as reference data frame : Ref = data.frame(c("a", "d", "c", "e", "f", "x"), matrix(NA, 6, 5)) colnames(Ref) = c("a1", "a2", "a3", "a4", "a5", "a6") Ref Now I have another data.frame, which I call as value data frame : Value = data.frame(c("x

Re: [R] A question about corAR1 and grouping

2016-01-08 Thread Jeff Newmiller
I don't understand your question, but lacking a reproducible example you may not get the attention of those who might be more likely to. -- Sent from my phone. Please excuse my brevity. On January 6, 2016 10:55:08 AM PST, Saptarshi Guha wrote: >Hello, > >I was under the impression that in a c

[R] A question about corAR1 and grouping

2016-01-06 Thread Saptarshi Guha
Hello, I was under the impression that in a call to gls, if i specify gls(.., cor=AR1(form= ~ 1 | subject)) and suppose there are N subjects, then i would have obtained estimates for N Phi (s) (the AR1 coefficient) - but I only get 1 estimate. I then checked "Linear Mixed-Effects Models Using R

[R] A question about SDE package

2015-10-18 Thread Shojaei Arani, Mohammad
Hello Friends, I am trying to use the functions ksdrift and ksdiff both in SDE package. Unfortunately. It does not work for my data (attached). The following code shows how I tried to use it: setwd("D:/Mohammad/Different/New folder") mydata <- read.csv("Best.csv", header=FALSE) myts<-ts(my

Re: [R] a question on write.table

2015-09-28 Thread Antonio Silva
Thanks Giorgio, David and Rui With the suggestions my problem was solved in different ways. Best regards Antonio 2015-09-28 15:52 GMT-03:00 Giorgio Garziano : > Try this: > > X<-c("A","B","C","D","E") > Y<-c(0,1,2,3,4) > > for (i in 0:3) { > Y<-Y+i > data<-data.frame(X,Y) > fe.flag <- f

Re: [R] a question on write.table

2015-09-28 Thread Giorgio Garziano
Try this: X<-c("A","B","C","D","E") Y<-c(0,1,2,3,4) for (i in 0:3) { Y<-Y+i data<-data.frame(X,Y) fe.flag <- file.exists("test.csv") write.table(data, "test.csv", row.names = FALSE, col.names = !fe.flag, sep=";", append = fe.flag) } [[alternative HTML version deleted]] _

Re: [R] a question on write.table

2015-09-28 Thread ruipbarradas
Hello, ifelse is a vectorized version of if/else, you want the normal if/else. if(file.exists(... etc ...)     [...] else     [...] Hope this helps, Rui Barradas   Citando Antonio Silva : > Dear R users > > I want to write a file that contains several data frames generated in a > loop > ing.

Re: [R] a question on write.table

2015-09-28 Thread David Winsemius
On Sep 28, 2015, at 11:31 AM, Antonio Silva wrote: > Dear R users > > I want to write a file that contains several data frames generated in a loop > ing. > I also want the column names be written to file only when it is created in > first loop. > > In the example below, when I run each line sep

[R] a question on write.table

2015-09-28 Thread Antonio Silva
Dear R users I want to write a file that contains several data frames generated in a loop ing. I also want the column names be written to file only when it is created in first loop. In the example below, when I run each line separately without "for (i in ...) { }" it works, but when I run the lo

Re: [R] a question about data manipulation in R

2015-09-15 Thread John Kane
20:59:59 + > To: zkarimi1...@yahoo.com > Subject: Re: [R] a question about data manipulation in R > > Given your "input: data frame, with variables "V1" and "V2", here's a > solution. This might not be the most "R-like" solution,

Re: [R] a question about data manipulation in R

2015-09-15 Thread John Posner
Given your "input: data frame, with variables "V1" and "V2", here's a solution. This might not be the most "R-like" solution, since I'm still more of a Python refugee than a native R coder. -John # analyze input, using run-length encoding runs_table = rle(input$V1) number_of_runs = length(runs

Re: [R] a question about data manipulation in R

2015-09-14 Thread John Kane
age- From: zkarimi1...@yahoo.com Sent: Mon, 14 Sep 2015 17:37:44 + (UTC) To: jrkrid...@inbox.com Subject: Re: [R] a question about data manipulation in R Dear John, Thank you for your response. my last item was 432. I Put my input and output file in duput() and this is the result: > dput(i

Re: [R] a question about data manipulation in R

2015-09-13 Thread John Kane
> Sent: Sun, 13 Sep 2015 05:12:07 + (UTC) > To: r-help@r-project.org > Subject: [R] a question about data manipulation in R > > Hello, > I have a data like this:1 2331 3331 4551 3452 5432 4332 3442 4003 4443 > 1113 0003 432I want to change it to this new dataset:c1    c2  

Re: [R] a question about data manipulation in R

2015-09-13 Thread Michael Dewey
Dear Zahra Your email is completely unreadable because you posted in HTML. Please reset your mailer and try again. On 13/09/2015 06:12, Zahra Karimi via R-help wrote: Hello, I have a data like this:1 2331 3331 4551 3452 5432 4332 3442 4003 4443 1113 0003 432I want to change it to this new da

[R] a question about data manipulation in R

2015-09-13 Thread Zahra Karimi via R-help
Hello, I have a data like this:1 2331 3331 4551 3452 5432 4332 3442 4003 4443 1113 0003 432I want to change it to this new dataset:c1    c2     c3233  543  444333  433  111455  344  000345  400  432  How can I do this in R? Please if this not the correct place to ask  my queston.. then could you

Re: [R] A question about nlmer in lme4 package

2015-07-11 Thread Ben Bolker
Patty Haaem via R-help r-project.org> writes: > Dear all,I have studied “Mixed models in R using the lme4 package > Part 6: Nonlinear mixed models” by Douglas Bates. In this tutorial, > there are some codes to fit nonlinear mixed models for Theoph > data. The codes are as [follows:] Th. start <

[R] A question about nlmer in lme4 package

2015-07-11 Thread Patty Haaem via R-help
Dear all,I have studied “Mixed models in R using the lme4 package Part 6: Nonlinear mixed models” by Douglas Bates. In this tutorial, there are some codes to fit nonlinear mixed models for Theoph data. The codes are as fallows:  >Th. start <- c(lKe = -2.5, lKa = 0.5 , lCl = -3)> nm1 <- nlmer ( co

Re: [R] a question about arimax, please

2014-10-07 Thread Jose Iparraguirre
C1H 9NB T 020 303 31482 E jose.iparragui...@ageuk.org.uk Twitter @jose.iparraguirre@ageuk -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess Sent: 06 October 2014 23:58 To: peter dalgaard Cc: R help Subject: Re: [R] a ques

Re: [R] a question about arimax, please

2014-10-06 Thread Erin Hodgess
This is great...thanks so much! On Mon, Oct 6, 2014 at 5:56 PM, peter dalgaard wrote: > In package TSA? > > You may need to do some studying for yourself, this is complicated stuff. > > As I read the help page, the intention is that the transfer= bit is to > allow a _covariate_ to affect the pr

Re: [R] a question about arimax, please

2014-10-06 Thread peter dalgaard
In package TSA? You may need to do some studying for yourself, this is complicated stuff. As I read the help page, the intention is that the transfer= bit is to allow a _covariate_ to affect the process in an ARMA-like fashion. So c(1,0) would be AR(1)-like which if I remember correctly corres

[R] a question about arimax, please

2014-10-06 Thread Erin Hodgess
Hello! I have about the arimax function, please: If you see the example page, you see the following: # Exhibit 11.6 air.m1=arimax(log(airmiles),order=c(0,1,1),seasonal=list(order=c(0,1,1), period=12),xtransf=data.frame(I911=1*(seq(airmiles)==69), I911=1*(seq(airmiles)==69)), transfer=list(c(0,0),c(

Re: [R] A question in Rinternals.h

2014-08-19 Thread PO SU
BTW, you say i always send html format email, finally i find that it is my mail server which send mail in html format by default., i should change the format eveytime before sending a mail... -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-08-19 06:28:06,

Re: [R] A question in Rinternals.h

2014-08-19 Thread PO SU
Tks for your guide, but before i know which maillist should i ask the question, i could only ask it here. 'figure out' i mean 'understand'. Forgive my pool english :). -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-08-19 06:28:06, "Prof Brian Ripley" wrote: >P

Re: [R] A question in Rinternals.h

2014-08-19 Thread Prof Brian Ripley
Please do read the posting guide (clearly you have not as you sent HTML). - This is the wrong list: it is a question about C code. - In any case, it is about C. The R Internals manual may help you, otherwise you need to talk to a local C adviser. (Even if this were not off-topic here, we do

[R] A question in Rinternals.h

2014-08-19 Thread PO SU
Dear Rusers, when i am reading Rinternals.h file, i can't understand the following codes in lines 395-407: #define CHAR(x)R_CHAR(x) const char *(R_CHAR)(SEXP x); /* Various tests with macro versions below */ Rboolean (Rf_isNull)(SEXP s); Rboolean (Rf_isSymbol)(SEXP s); Rboolean (Rf_isLogic

Re: [R] A question about call()

2014-07-24 Thread super
Thanks a lot, it is much clear to me now, but i still have a question:The raw question is from:Hadley wickham's book advanced r programming, Chapter Meta programming, section expressions, in the part "Creating a call from its components"He said:To create a new call from its components, you ca

Re: [R] A question about call()

2014-07-24 Thread Duncan Murdoch
On 24/07/2014, 2:41 AM, super wrote: > The question is as below: > Exercises > 1.The following two calls look the same, but are actually different: > (a <- call("mean", 1:10)) > #> mean(1:10) This one creates a call where the first argument is a vector containing 10 elements. > (b <- call("mean

Re: [R] A question about call()

2014-07-24 Thread Jeff Newmiller
Please read the Posting Guide. There is a no HTML policy and a no homework policy. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

[R] A question about call()

2014-07-23 Thread super
The question is as below: Exercises 1.The following two calls look the same, but are actually different: (a <- call("mean", 1:10)) #> mean(1:10) (b <- call("mean", quote(1:10))) #> mean(1:10) identical(a, b) #> [1] FALSE What¡¯s the difference? Which one should you prefer? So, how i can figure ou

[R] A question about call()

2014-07-23 Thread super
The question is as below: Exercises 1.The following two calls look the same, but are actually different: (a <- call("mean", 1:10)) #> mean(1:10) (b <- call("mean", quote(1:10))) #> mean(1:10) identical(a, b) #> [1] FALSE What¡¯s the difference? Which one should you prefer? So, how i can figure ou

Re: [R] A Question about read.table and Data Frames in R

2014-06-30 Thread David L Carlson
M To: Robert Sherry Cc: r-help@r-project.org Subject: Re: [R] A Question about read.table and Data Frames in R On Jun 29, 2014, at 3:22 PM, Robert Sherry wrote: > I created the following file: > > symbol,shares > XOM,1000 > APA,400 > CVX,200 > > I then read the file in R us

Re: [R] A Question about read.table and Data Frames in R

2014-06-29 Thread David Winsemius
On Jun 29, 2014, at 3:22 PM, Robert Sherry wrote: I created the following file: symbol,shares XOM,1000 APA,400 CVX,200 I then read the file in R using the command: stockList=read.table("/NotesOnR/stockList", header = T, sep=",") I would then expect the following expression to evaluat

[R] A Question about read.table and Data Frames in R

2014-06-29 Thread Robert Sherry
I created the following file: symbol,shares XOM,1000 APA,400 CVX,200 I then read the file in R using the command: stockList=read.table("/NotesOnR/stockList", header = T, sep=",") I would then expect the following expression to evaluate to the simple string APA: stockList$symbol[

Re: [R] a question about the output of plot

2014-04-15 Thread meng
Thanks. -- QQ: 1733768559 At 2014-04-15 17:56:01,"Jim Lemon" wrote: >On 04/15/2014 07:51 PM, meng wrote: >> Yes,it works ! >> What's the reason for it? >> >Hi meng, >As I understand it, the lattice graphics system produces plot >objects, not actual output on a graphic device. This is in

Re: [R] a question about the output of plot

2014-04-15 Thread Richard M. Heiberger
Please see R FAQ 7.22 7.22 Why do lattice/trellis graphics not work? == The most likely reason is that you forgot to tell R to display the graph. Lattice functions such as `xyplot()' create a graph object, but do not display it (the same is true of *ggp

Re: [R] a question about the output of plot

2014-04-15 Thread meng
Yes,it works ! What's the reason for it? Many thanks! -- QQ: 1733768559 At 2014-04-15 14:36:41,"Jim Lemon" wrote: >On 04/15/2014 11:46 AM, meng wrote: >> Hi all: >> I met a question about the output of plot. >> I want to output 3 plots. >> Method1: by function histogram{lattice} >> Me

  1   2   3   4   5   6   >