Re: [R] NADA

2013-03-21 Thread Jeff Newmiller
Somebody just might be able to help if you read the Posting Guide mentioned in the email footer, post using plain text, and make a reproducible example [1]. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Re: [R] why a moving average fun takes too long time!!

2013-03-21 Thread Alemu Tadesse
I have so many gz files of the type (filename.nc.gz) where nc stands for netcdf file. I used the following commands : path=C:/Documents and settings/AER/NorthAmerica-West/zipedfiles/ # examples of zipped files files - list.files(path, recursive=TRUE, full.names=TRUE) files - grep(.*\\.gz$,

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread Pierrick Bruneau
Hi Borja, You may issue: attach(data) which results in adding your column names to the search path of R for name resolving. Pierrick Bruneau CRP Gabriel Lippmann On Wed, Mar 20, 2013 at 11:17 PM, Borja . borjalato...@outlook.com wrote: Good day. I create a data frame like this:

Re: [R] behaviour of formula objects and environment inside functions

2013-03-21 Thread Thomas Alexander Gerds
thanks for your answers and sorry that I didnt explain the problem/question sufficiently in the first place. here it comes: the problem is that when I create a formula inside a function and some large objects exist there too, then saving the output of the formula will save the in this case large

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread Michael Weylandt
On Mar 21, 2013, at 7:39, Pierrick Bruneau pbrun...@gmail.com wrote: Hi Borja, You may issue: attach(data) No -- bad idea -- dangerous -- confusing statefulness, etc. (See explanations in the archives as to why) which results in adding your column names to the search path of R for

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread Jorge I Velez
Or simply subset(dat, a 0) HTH, Jorge.- On Thu, Mar 21, 2013 at 6:58 PM, Michael Weylandt wrote: On Mar 21, 2013, at 7:39, Pierrick Bruneau pbrun...@gmail.com wrote: Hi Borja, You may issue: attach(data) No -- bad idea -- dangerous -- confusing statefulness, etc. (See

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread Pierrick Bruneau
OK, I just had a look at the Good Practice section of ?attach, it indeed looks bad... Maybe this danger should be emphasized in ?attach, or the function even deprecated (why maintaining ugly patterns when better solutions exist?) On Thu, Mar 21, 2013 at 8:58 AM, Michael Weylandt

[R] boxplot

2013-03-21 Thread carol white
Hi, It must be an easy question but how to boxplot a subset of data: data = read.table(my_data.txt, header = T) boxplot(data$var1[data$loc == nice]~data$loc_type[data$loc == nice]) #in this case, i want to display only the boxplot loc == nice #doesn't display the boxplot of only loc == nice. It

Re: [R] how to skip part of the code

2013-03-21 Thread PIKAL Petr
Hi as David pointed out e is probably slightly bigger than 0. Easiest way is probably if (round(e) 0) { res -bugs(list(); k -5+2 } Regards Petr From: Andras Farkas [mailto:motyoc...@yahoo.com] Sent: Wednesday, March 20, 2013 3:53 PM To: PIKAL Petr; Robert Baer Cc: r-help@r-project.org

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread PIKAL Petr
Hi in interactive sessions it is convenient way to call data frame columns and repeatedly use them in calculations. You just have to be careful with some functions as they can be useful but dangerous. rm(something) removes an object from environment without warning. It is usually not a fault

Re: [R] boxplot

2013-03-21 Thread Jim Lemon
On 03/21/2013 07:40 PM, carol white wrote: Hi, It must be an easy question but how to boxplot a subset of data: data = read.table(my_data.txt, header = T) boxplot(data$var1[data$loc == nice]~data$loc_type[data$loc == nice]) #in this case, i want to display only the boxplot loc == nice #doesn't

[R] All unique combinations

2013-03-21 Thread Alaios
Dear all, I would like to have all unique combinations in the following matrix TimeIndex- rbind (c(1,Week_of_21_07-29_03),           c(2,Thursday_21_03),           c(3,Friday_22_03),           c(4,Saturday_23_03),           c(5,Sunday_24_03),           c(6,Monday_25_03),          

[R] values for the scree plot (package psych)

2013-03-21 Thread Dimitri Liakhovitski
Hello, I am using function princomp from the package psych. I have my principle component object mypc: mypc - princomp(covmat=mycor) plot(mypc) # shows me a screeplot Question: how could I actually see the values displayed in the screeplot. I don't mean on the graph - I just want to know the

Re: [R] All unique combinations

2013-03-21 Thread Blaser Nello
It isn't entirely clear to me if you want to remove duplicates or expand your matrix. Check ?unique or ?expand.grid. Here are some guesses of what you may want to do. unique(TimeIndex) expand.grid(as.data.frame(TimeIndex)) expand.grid(as.data.frame(unique(TimeIndex))) TimeIndex2 -

Re: [R] values for the scree plot (package psych)

2013-03-21 Thread Blaser Nello
The plot shows the variation for each component and mypc$sdev gives you the standard deviation. If you want to know the variation, use mypc$sdev^2. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Dimitri Liakhovitski Sent:

[R] Compatibility problem Iramuteq / R : help !!!

2013-03-21 Thread Arthur Borriello
Hi, I try to run the Iramuteq software with R, on Windows 7 professional (latest version of Iramuteq, and I tried with the three latest versions of R). I properly installed the packages and coded the texts, but anytime I want to run the analysis, I receive this error message : Erreur R None1 None

[R] Excuse me

2013-03-21 Thread 李楠
Dear R software faculty:       There is a question bothering me. That is why we can not set the property of row.names=false when we output csv data. But there exists that parameter in R help. Hoping for your reply! Best regards!                            

Re: [R] Compatibility problem Iramuteq / R : help !!!

2013-03-21 Thread John Kane
Data? Code? https://github.com/hadley/devtools/wiki/Reproducibility John Kane Kingston ON Canada -Original Message- From: aborr...@ulb.ac.be Sent: Thu, 21 Mar 2013 12:10:13 +0100 To: r-help@r-project.org Subject: [R] Compatibility problem Iramuteq / R : help !!! Hi, I try to

Re: [R] Excuse me

2013-03-21 Thread John Kane
If I remember correctly this was possible a few versions ago but was dropped. To do it now you need to use write.table and set row.names = FALSE. John Kane Kingston ON Canada -Original Message- From: lina...@pku.edu.cn Sent: Thu, 21 Mar 2013 16:27:18 +0800 (CST) To:

Re: [R] values for the scree plot (package psych)

2013-03-21 Thread Dimitri Liakhovitski
Thank you very much! On Thu, Mar 21, 2013 at 8:16 AM, Blaser Nello nbla...@ispm.unibe.ch wrote: The plot shows the variation for each component and mypc$sdev gives you the standard deviation. If you want to know the variation, use mypc$sdev^2. -Original Message- From:

Re: [R] Excuse me

2013-03-21 Thread Kevin E. Thorpe
On 03/21/2013 08:38 AM, John Kane wrote: If I remember correctly this was possible a few versions ago but was dropped. To do it now you need to use write.table and set row.names = FALSE. John Kane Kingston ON Canada I used write.csv with row.names=FALSE yesterday with no issues at all in

Re: [R] How to look at the source code for predict()

2013-03-21 Thread Yuan, Rebecca
Hello Rui, This also works! Thanks so much! Cheers, Rebecca -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Wednesday, March 20, 2013 3:34 PM To: Yuan, Rebecca Cc: 'R help' Subject: Re: [R] How to look at the source code for predict() Hello, In the case of

Re: [R] Excuse me

2013-03-21 Thread John Kane
I could have sworn I could not to this in 2.10 or something like that. Thanks for saying it is still there. John Kane Kingston ON Canada -Original Message- From: kevin.tho...@utoronto.ca Sent: Thu, 21 Mar 2013 08:52:17 -0400 To: jrkrid...@inbox.com Subject: Re: [R] Excuse me

[R] Help on indicator variables

2013-03-21 Thread Tasnuva Tabassum
I have two indicator variables ABS and DEFF. I want to create another indicator variable which will take value 1 if either ABS=1 or DEFF=1. Otherwise, it will take value 0. How can I make that? [[alternative HTML version deleted]] __

[R] Need help to plot clara results [clustering]

2013-03-21 Thread capricy gao
I am going to use clara for  gene expression analysis, so tried to play around with the examples from R document: http://127.0.0.1:10699/library/cluster/html/clara.html Everything looked fine until I tried to plot the results: it says: waiting to confirm page change... I waited for more

Re: [R] Help on indicator variables

2013-03-21 Thread Jorge I Velez
Try ifelse(ABS ==1 | DEFF == 1, 1, 0) HTH, Jorge.- On Fri, Mar 22, 2013 at 12:02 AM, Tasnuva Tabassum t.tasn...@gmail.comwrote: I have two indicator variables ABS and DEFF. I want to create another indicator variable which will take value 1 if either ABS=1 or DEFF=1. Otherwise, it will

[R] multiple peak fit

2013-03-21 Thread PIKAL Petr
Hi I went through some extensive search to find suitable method (package, function) to fit multiple peaks. The best I found is ALS package but it requires rather complicated input structure probably resulting from GC-MS experimental data and seems to be an overkill to my problem. I have

Re: [R] boxplot

2013-03-21 Thread David L Carlson
Your variable loc_type combines information from two variables (loc and type). Since you are subsetting on loc, why not just plot by type? boxplot(var1~type, data[data$loc==nice,]) -- David L Carlson Associate Professor of Anthropology Texas AM

[R] How to store data frames into pdf file and csv file.

2013-03-21 Thread Yuan, Rebecca
Hello, I have a data frame mdl.summary est.coef std.errt.stat intercept 0.0011625517 0.0002671437 4.351784 aa -0.0813727439 0.0163727943 -4.969997 dummy1 -0.0002534873 0.0001204000 -2.105376

[R] Could I get the following stats from arima()?

2013-03-21 Thread Yuan, Rebecca
Hello all, I use the arima to get a model, i.e. fit = arima(x,order=c(1,0,0)) and I know I can get the following from fit via est.coef = coef(fig) est.aic = fit$aic std.err = sqrt(diag(vcov(fit))) t.stat = est.coef/std.err

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread Bert Gunter
Well, you might start by reading ?pdf, where you will find that it is for storing **graphics** not data! Then read ?write.table -- but this will be a text file, not a pdf. -- Bert On Thu, Mar 21, 2013 at 6:20 AM, Yuan, Rebecca rebecca.y...@bankofamerica.com wrote: Hello, I have a data

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread jim holtman
Here is one way of doing it: x est.coef std.errt.stat intercept 0.0011625517 0.0002671437 4.351784 aa-0.0813727439 0.0163727943 -4.969997 dummy1-0.0002534873 0.0001204000 -2.105376 dummy2-0.0007784864 0.0001437537 -5.415417 bb-0.0002856727

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread Yuan, Rebecca
Hello Jim, I tried the following as you mentioned, but I still do not have the error while opening the pdf file. pdf(file = result2, paper = a4r) mdl.summary.out-capture.output(mdl.summary) plot.new()

[R] How could I specify no interception term in arima?

2013-03-21 Thread Yuan, Rebecca
Hello, I cannot find it in ?arima, does someone know how to specify no interception term in arima? Thanks, Rebecca -- This message, and any attachments, is for the intended r...{{dropped:5}}

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread jim holtman
Here is the script I ran to get PDF output which is attached: x # capture the output as a string vector xo - capture.output(x) pdf('/temp/output.pdf') plot.new() # new page # now add text to plot text(0 , 0.5 , paste(xo, collapse = '\n') , family = 'mono' , cex = 0.6 , adj =

Re: [R] Help on indicator variables

2013-03-21 Thread Göran Broström
On 03/21/2013 02:08 PM, Jorge I Velez wrote: Try ifelse(ABS ==1 | DEFF == 1, 1, 0) or as.numeric(ABS | DEFF) (faster?) Göran HTH, Jorge.- On Fri, Mar 22, 2013 at 12:02 AM, Tasnuva Tabassum t.tasn...@gmail.comwrote: I have two indicator variables ABS and DEFF. I want to create

Re: [R] bigmemory: Using backing file as alternate to write.big.matrix

2013-03-21 Thread Shraddha Pai
OK, did a test where I did both - wrote a ~6Mx58 double matrix as a .txt file (write.big.matrix), but also left the backing file + descriptor file as-is (rather than deleting it as I usually do). Opened a different R session. Compared contents of first 100 rows of both, they seem identical.

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread Yuan, Rebecca
Hello Jim, This graphics.off() helps me to release the previous pdf file that was had the error message. Thanks again for your help! Cheers, Rebecca From: jim holtman [mailto:jholt...@gmail.com] Sent: Thursday, March 21, 2013 10:07 AM To: Yuan, Rebecca Cc: R help Subject: Re: [R] How to store

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread Yuan, Rebecca
Hello Jim, Thanks very much! This time I am able to get the pdf file. Best regards, Rebecca From: jim holtman [mailto:jholt...@gmail.com] Sent: Thursday, March 21, 2013 10:04 AM To: Yuan, Rebecca Cc: R help Subject: Re: [R] How to store data frames into pdf file and csv file. Here is the

Re: [R] How to store data frames into pdf file and csv file.

2013-03-21 Thread jim holtman
If you are getting an error when trying to open the PDF file, then you may of had a error writing out a previous file. I always issue the following command to clear out any pending graphic output: graphics.off() On Thu, Mar 21, 2013 at 9:49 AM, Yuan, Rebecca rebecca.y...@bankofamerica.com

[R] Bayesian network

2013-03-21 Thread zermani
HeLLo, I'm new in R, I would like to use it for diagnostics with bayesian network, I want to know how can I calculate inference and if can I enter my probability tables like logical or arithmetic equation, Thanks. -- View this message in context:

Re: [R] Error message installing package R package

2013-03-21 Thread Pramod Anugu
I am getting error messages while installing R package lme4. Please advice thanks Pramod trying URL 'http://cran.mtu.edu/src/contrib/lme4_0.99-0.tar.gz' Content type 'application/x-gzip' length 1074142 bytes (1.0 Mb) opened URL ==

Re: [R] Help on indicator variables

2013-03-21 Thread William Dunlap
I would use a logical variable, with values TRUE and FALSE, instead of a numeric indicator. E.g., I find the following easier to follow bL - ABS==1 | DEFF==1 if (any(bL)) { do.this() } than bN - ifelse(ABS == 1 | DEFF == 1, 1, 0) if (any(bN == 1)) { do.this() } The latter leaves

[R] Re-order variables listed in nomogram?

2013-03-21 Thread Rapsomaniki, Eleni
Hi, I am using the function nomogram in the rms package for survival analysis. How is the order in which variables determined and how can I change it? I use it with a cph() model. Many Thanks Eleni Rapsomaniki Clinical Epidemiology Group Department of Epidemiology and Public Health University

Re: [R] NADA

2013-03-21 Thread MacQueen, Don
According to ?ros, one of the arguments is: reverseT: A name of a function to use for reversing the transformation after performing the ROS fit. Defaults to 'exp'. And in the Details section: By default, 'ros' performs a log transformation prior to, and after operations over the

[R] adaptIntegrate function

2013-03-21 Thread li li
Hi all, it seems that there is problem with function adaptIntegrate, when the integration limits is infinity. Please see the code below. The second integration does not seem to work. Can anyone familiar with this give some help? Thank you with much. Hanna library(mnormt)

[R] easy way of paste

2013-03-21 Thread Yuan, Rebecca
Hello, Is there a better way to use paste such as: a = paste(colnames(list.indep)[1],colnames(list.indep)[2],colnames(list.indep)[3],colnames(list.indep)[4],colnames(list.indep)[5],sep=+) a [1] aa+dummy1+dummy2+bb+cc I tried a = paste(colnames(list.indep)[1:5],sep=+) a [1] aa

Re: [R] easy way of paste

2013-03-21 Thread Sarah Goslee
It looks like you want collapse rather than sep: list.indep - data.frame(aa=1:4, dummy1=1:4, dummy2=1:4, bb=1:4, cc=1:4) paste(colnames(list.indep), collapse=+) [1] aa+dummy1+dummy2+bb+cc On Thu, Mar 21, 2013 at 11:15 AM, Yuan, Rebecca rebecca.y...@bankofamerica.com wrote: Hello, Is there a

Re: [R] adaptIntegrate function

2013-03-21 Thread Blaser Nello
Under ?adaptIntegrate, you will find the link to http://ab-initio.mit.edu/wiki/index.php/Cubature#Infinite_intervals, where it says that Integrals over infinite or semi-infinite intervals is possible by a change of variables. -Original Message- From: r-help-boun...@r-project.org

Re: [R] easy way of paste

2013-03-21 Thread arun
 dat2-as.data.frame(matrix(1:20,ncol=5))  colnames(dat2)- c(aa,dummy1,dummy2,bb,cc)  paste(colnames(dat2),collapse=+) #[1] aa+dummy1+dummy2+bb+cc A.K. - Original Message - From: Yuan, Rebecca rebecca.y...@bankofamerica.com To: R help r-help@r-project.org Cc: Sent: Thursday, March 21,

Re: [R] new question

2013-03-21 Thread arun
Sorry, I am not sure I understand your question.  You have 5 boxplots(if I remember correctly) on a single page and these 5 boxplots have titles a1,a2,c1,c2,t1 (or something like that). Could you try: par(mfcol(c(3,2)) and see if that helps. (not tested) A.K.

Re: [R] how to skip part of the code

2013-03-21 Thread Andras Farkas
Pikal and Robert,   sorry for previous email, indeed, the code is working just fine!   Thanks for the pointer David Winsemius, you were right, I was getting a character as numeric(0), which the system did not recognize as the number 0, thus the openBUGS run was called.   Thanks for the help

Re: [R] Bayesian network

2013-03-21 Thread John Kane
You might want to start by reading the Bayesian task view at http://probability.ca/cran/ John Kane Kingston ON Canada -Original Message- From: s_zerm...@esi.dz Sent: Thu, 21 Mar 2013 07:06:40 -0700 (PDT) To: r-help@r-project.org Subject: [R] Bayesian network HeLLo, I'm new in

Re: [R] adaptIntegrate function

2013-03-21 Thread li li
Got it. Thank you very much! library(mnormt) library(cubature) ff - function(x, rho){ mu - rep(0,3) Sigma -(1-rho)*diag(3)+matrix(rho,3,3) f - dmnorm(x/(1-x^2), mu, Sigma)*((1+x^2)/(1-x^2)^2) f }

Re: [R] how to skip part of the code

2013-03-21 Thread David Winsemius
On Mar 21, 2013, at 8:30 AM, Andras Farkas wrote: Pikal and Robert, sorry for previous email, indeed, the code is working just fine! Thanks for the pointer David Winsemius, you were right, I was getting a character as numeric(0), which the system did not recognize as the number 0,

Re: [R] easy way of paste

2013-03-21 Thread Yuan, Rebecca
Hello Sarah, Yes, that is what I want. Thanks! Cheers, Rebecca -Original Message- From: Sarah Goslee [mailto:sarah.gos...@gmail.com] Sent: Thursday, March 21, 2013 11:21 AM To: Yuan, Rebecca Cc: R help Subject: Re: [R] easy way of paste It looks like you want collapse rather than

Re: [R] easy way of paste

2013-03-21 Thread Yuan, Rebecca
Hello A.K., Thanks! I use collapse instead of sep and get the answer. Cheers, Rebecca -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Thursday, March 21, 2013 11:21 AM To: Yuan, Rebecca Cc: R help Subject: Re: [R] easy way of paste  

[R] rJava problem on ubuntu

2013-03-21 Thread Todd Kaplan
i'm having trouble using rJava on ubuntu 11.10 amd 64-bit. when i try to source my code that uses rJava, i get the following error: Error : .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object

Re: [R] Error message installing package R package

2013-03-21 Thread Ben Bolker
Pramod Anugu pramod.r.anugu at jsums.edu writes: I am getting error messages while installing R package lme4. Please advice This would be better on the r-sig-mixed-mod...@r-project.org list. You haven't told us, but I'm guess from what you've pasted below that you're on a Unix system, and

Re: [R] new question

2013-03-21 Thread arun
Hi, Try this: directory- /home/arunksa111/dados GetFileList - function(directory,number){  setwd(directory)  filelist1-dir()[file.info(dir())$isdir]     direct-dir(directory,pattern = paste(MSMS_,number,PepInfo.txt,sep=), full.names = FALSE, recursive = TRUE)  direct-lapply(direct,function(x)

[R] Check if a character vector can be coerced to numeric?

2013-03-21 Thread Jonathan Greenberg
Given an arbitrary set of character vectors: myvect1 - c(abc,3,4) myvect2 - c(2,3,4) I would like to develop a function that will convert any vectors that can be PROPERLY converted to a numeric (myvect2) into a numeric, but leaves character vectors which cannot be converted (myvect1) alone. Is

Re: [R] Check if a character vector can be coerced to numeric?

2013-03-21 Thread Prof Brian Ripley
On 21/03/2013 18:20, Jonathan Greenberg wrote: Given an arbitrary set of character vectors: myvect1 - c(abc,3,4) myvect2 - c(2,3,4) I would like to develop a function that will convert any vectors that can be PROPERLY converted to a numeric (myvect2) into a numeric, but leaves character

Re: [R] Check if a character vector can be coerced to numeric?

2013-03-21 Thread Jeff Newmiller
Using capital letters does not improve clarity... it just offends people. Does read.table and friends not do this to your satisfaction already with as.is=TRUE? If not, shouldn't coercing it and checking for NA serve? ---

Re: [R] How could I specify no interception term in arima?

2013-03-21 Thread Rui Barradas
Hello, In fact, it's written there, in ?arima: Further, if include.mean is true (the default for an ARMA model), this formula applies to X - m rather than X. So, use include.mean = FALSE Hope this helps, Rui Barradas Em 21-03-2013 13:56, Yuan, Rebecca escreveu: Hello, I cannot find it

Re: [R] how do I read certain files from a directory based on number of columns?

2013-03-21 Thread iembry
Hi Arun, thank you. I will look through that later on today when I get a chance. I have to complete another part of this project now. Irucka -Original Message- From: arun kirshna [via R] [ml-node+s789695n4661145...@n4.nabble.com] Sent: 3/12/2013 10:35:39 PM To: iruc...@mail2world.com

Re: [R] [[i]]$ - indexing and lapply

2013-03-21 Thread iembry
Hi Arun, thank-you very much! The 2nd option worked perfectly. That was what I wanted. Now, I have another question. I am using the R packages dataRetrieval and EGRET from https://github.com/USGS-CIDA/WRTDS. I have 2 objects Daily and Sample that have the naming convention (Names =

Re: [R] plot and save as png

2013-03-21 Thread veepsirtt
Hi A.K This is working layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) plot(sin, -pi, 10*pi) plot(sin, -pi, 20*pi) plot(sin, -pi, 30*pi) plot(sin, -pi, 40*pi) dev.off() but if I add this line png(filename = fname.png, width = 900, height = 600, units = 'px') no plot is generated. where is the

Re: [R] Bayesian network

2013-03-21 Thread zermani
Yes, thanks but with package for the Bayesians networks ? -- View this message in context: http://r.789695.n4.nabble.com/Bayesian-network-tp4662059p4662085.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] Error Message During ANOVA

2013-03-21 Thread Rodinsky, Dr Harold R.
I am teaching myself R for use in Psych research. I don't understand the error message I am getting or how to fix it. Any suggestions will be greatly appreciated df1=read.table(fastfood.txt, header=TRUE); df1 c(t(as.matrix(df1))) r = c(t(as.matrix(df1))) # response data r

Re: [R] basic sweave question

2013-03-21 Thread lgh0504
you are welcome! On Thu, Mar 14, 2013 at 6:01 PM, susieboyce [via R] ml-node+s789695n4661296...@n4.nabble.com wrote: Thank you for your reply. I have found the pdflatex file. I was able to solve my 'Sweave.sty not found' error by coping the Sweave.sty file and pasting it into the working

[R] step halving factor reduced below minimum

2013-03-21 Thread Stephen Jane
Hello,   I am attempting to use nlme to model the response of 19 groups.  I am able to get a reasonable fit of all of the groups to the observed data using an exponential decay model (a*exp-x*b).  The problem is that when I plot the fitted values to residuals, it demonstrates a pattern of

Re: [R] basic sweave question

2013-03-21 Thread lgh0504
The pdflatex is the an excutable programe located in your MiKTex‘ bin folder, I guess you have not add your MikTex bin folder into your Windows PATH environment On Thu, Mar 14, 2013 at 12:55 AM, susieboyce [via R] ml-node+s789695n4661220...@n4.nabble.com wrote: I have located my Sweave.sty

Re: [R] Check if a character vector can be coerced to numeric?

2013-03-21 Thread Jonathan Greenberg
Yep, type.convert was exactly what I was looking for (with as.is=TRUE). Thanks! On Thu, Mar 21, 2013 at 1:31 PM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote: On 21/03/2013 18:20, Jonathan Greenberg wrote: Given an arbitrary set of character vectors: myvect1 - c(abc,3,4) myvect2 -

Re: [R] plot and save as png

2013-03-21 Thread Sarah Goslee
Hi, So when you run the code suggested: png(filename = fname.png, width = 900, height = 600, units = 'px') layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) plot(sin, -pi, 10*pi) plot(sin, -pi, 20*pi) plot(sin, -pi, 30*pi) plot(sin, -pi, 40*pi) dev.off() exactly like that, you do not get a file

Re: [R] How could I specify no interception term in arima?

2013-03-21 Thread Yuan, Rebecca
Hello Rui, Thanks! I get it now. Should have read the documentation carefully! Cheers, Rebecca -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Thursday, March 21, 2013 2:46 PM To: Yuan, Rebecca Cc: R help Subject: Re: [R] How could I specify no interception

Re: [R] plot and save as png

2013-03-21 Thread arun
Hi, I am not sure about the problem. I am able to generate the pdf. with the codes: png(filename = fname.png, width = 900, height = 600, units = 'px') layout(matrix(c(1,2,3,4), 4, 1, byrow = TRUE)) plot(sin, -pi, 10*pi) plot(sin, -pi, 20*pi) plot(sin, -pi, 30*pi) plot(sin, -pi, 40*pi) dev.off()

Re: [R] Error Message During ANOVA

2013-03-21 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rodinsky, Dr Harold R. Sent: Thursday, March 21, 2013 11:32 AM To: 'r-help@r-project.org' Subject: Re: [R] Error Message During ANOVA I am teaching myself R for use in Psych

Re: [R] Could I get the following stats from arima()?

2013-03-21 Thread Rui Barradas
Hello, Inline. Em 21-03-2013 13:34, Yuan, Rebecca escreveu: Hello all, I use the arima to get a model, i.e. fit = arima(x,order=c(1,0,0)) and I know I can get the following from fit via est.coef = coef(fig) est.aic = fit$aic std.err =

Re: [R] Displaying median value over the horizontal(median)line in the boxplot

2013-03-21 Thread arun
Hi, set.seed(45) test1-data.frame(columnA=rnorm(7,45),columnB=rnorm(7,10)) #used an example probably similar to your actual data apply(test1,2,function(x) sprintf(%.1f,median(x))) #columnA columnB # 44.5  10.2 par(mfrow=c(1,2)) lapply(test1,function(x) {b-

[R] PGLMM in Picante Question

2013-03-21 Thread Frank Burbrink
Hi Guys, Using the PGLMM function in Picante it is theoretically possible to generate other models (than the 5 flagged ones indicated) by differently structuring the independent variable (Y), dependent variables (X), and covariance matrices (VV). I was wondering anyone could give me some advice

[R] Control variables in mediation analysis

2013-03-21 Thread F.Doerwald
Hi everyone,I would like to test a mediation model, that has several control variables. More specifically, I would like to test the indirect effect with bootstrapping. However, all the packages I have found so far (e.g. MBESS) only allow testing a simple mediation model (One independent, one

[R] order statistic of multivariate normal

2013-03-21 Thread li li
Hi all, Is there an R function that computes the probabilty or quantiles of order statistics of multivariate normal? Thank you. Hanna [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Control variables in mediation analysis

2013-03-21 Thread Ista Zahn
Hi, Just about anything can be bootstrapped, that's one of the things that makes bootstrapping great! Use e.g., the boot package, and bootstrap the product of the coefficients. Alternatively the mediation package (http://cran.r-project.org/web/packages/mediation/index.html) might help, though

[R] [mgcv][gam] Odd error: Error in PredictMat(object$smooth[[k]], data) : , `by' variable must be same dimension as smooth arguments

2013-03-21 Thread Andrew Crane-Droesch
Dear List, I'm getting an error in mgcv, and I can't figure out where it comes from. The setup is the following: I've got a fitted GAM object called MI, and a vector of prediction data (with default values for predictors). I feed this into predict.gam(object, newdata = whatever) via the

Re: [R] order statistic of multivariate normal

2013-03-21 Thread David Winsemius
On Mar 21, 2013, at 1:44 PM, li li wrote: Hi all, Is there an R function that computes the probabilty or quantiles of order statistics of multivariate normal? Thank you. There is an mvtnorm package. I don't know what you mean by quantiles of order statistics of multivariate normal,

Re: [R] PGLMM in Picante Question

2013-03-21 Thread Ben Bolker
Frank Burbrink burbrink666 at gmail.com writes: Using the PGLMM function in Picante it is theoretically possible to generate other models (than the 5 flagged ones indicated) by differently structuring the independent variable (Y), dependent variables (X), and covariance matrices (VV). I was

Re: [R] Re-order variables listed in nomogram?

2013-03-21 Thread Frank Harrell
nomogram does not have an option for specifying a new order for the variables. With some exceptions you should be able to reorder the variables in the model formula to achieve the desired result. Frank Eleni Rapsomaniki-3 wrote Hi, I am using the function nomogram in the rms package for

Re: [R] order statistic of multivariate normal

2013-03-21 Thread Albyn Jones
R^n for n 1 is not an ordered set. albyn On Thu, Mar 21, 2013 at 02:32:44PM -0700, David Winsemius wrote: On Mar 21, 2013, at 1:44 PM, li li wrote: Hi all, Is there an R function that computes the probabilty or quantiles of order statistics of multivariate normal? Thank you.

Re: [R] Control variables in mediation analysis

2013-03-21 Thread John Fox
Dear Ista and F.Doerwald, F.Doerwald could also fit a model using sem() in the sem package, and then use deltaMethod() in the car package to get the estimated value and standard error of any function of model coefficients that he or she chooses. Sorry, I didn't read the original posting. I

Re: [R] multiple peak fit

2013-03-21 Thread Adams, Jean
Petr, You could use nonlinear regression to fit two Guassian peaks. For example, fit - nls(sig ~ d + a1*exp(-0.5*((time-c1)/b1)^2) + a2*exp(-0.5*((time-c2)/b2)^2), start=list(a1=15, b1=20, c1=315, a2=4, b2=50, c2=465, d=1.5), data=temp) plot(temp, type=l) lines(temp$time, predict(fit), lty=2,

Re: [R] Reading dataset in R

2013-03-21 Thread arun
Hi, con-file(Rout1112.text)  Lines1- readLines(con)  close(con)  indx-rep(rep(c(TRUE,FALSE),each=2),2)  Lines2-Lines1[!grepl([A-Za-z],Lines1)] res-read.table(text=paste(gsub(^\\d+\\s+,,Lines2[indx]),gsub(^\\d+\\s+,,Lines2[!indx])),sep=,header=FALSE)  nm1-unlist(strsplit(gsub(^

Re: [R] Control variables in mediation analysis

2013-03-21 Thread Bert Gunter
Well, yeah ... but it doesn't necessarily follow that the result converges to what you want. Bootstrapping extreme order statistics is an example. -- Bert On Thu, Mar 21, 2013 at 1:49 PM, Ista Zahn istaz...@gmail.com wrote: Hi, Just about anything can be bootstrapped, that's one of the

Re: [R] order statistic of multivariate normal

2013-03-21 Thread Rui Barradas
Hello, Em 21-03-2013 21:42, Albyn Jones escreveu: R^n for n 1 is not an ordered set. Theorem. All sets are well ordered. (This theorem is equivalent to the Axiom of Choice.) Rui Barradas albyn On Thu, Mar 21, 2013 at 02:32:44PM -0700, David Winsemius wrote: On Mar 21, 2013, at 1:44

[R] Problems of exporting raster to ArcGIS

2013-03-21 Thread yj.xu.ecology
Hello: I am using R raster package to replace ArcGIS when processing multiple shp files. However, when I export R raster back to ArcGIS, it couldn't recognize R raster file correctly. For example, I used {raster} package and got a RasterLayer as followed. class : RasterLayer

[R] vector field from a 3D scalar field

2013-03-21 Thread Waichler, Scott R
I have a 3D field of a scalar variable (x, y, z, value). Is there a way to generate a vector field from this data--gradient at defined points? I found the rasterVis package for 2D data, but as yet nothing for 3D data. Thanks, Scott Waichler Pacific Northwest National Laboratory Richland, WA

Re: [R] vector field from a 3D scalar field

2013-03-21 Thread David Winsemius
On Mar 21, 2013, at 4:40 PM, Waichler, Scott R wrote: I have a 3D field of a scalar variable (x, y, z, value). Is there a way to generate a vector field from this data--gradient at defined points? I found the rasterVis package for 2D data, but as yet nothing for 3D data. Can't you just

[R] Clever way to match two lists

2013-03-21 Thread Noah Silverman
Hello, I have a large data.frame of 80,000 rows where each row is a record. Each record is indexed by a unique ID in the first column. I need to update values for a column for *some* of the records. I was given a data.frame with about 10,000 rows and two columns. The first is the record ID,

Re: [R] Clever way to match two lists

2013-03-21 Thread Jim Holtman
indx - match(main.df$id, key$id, nomatch = 0) main.df$value[indx != 0] - key$value[indx] Sent from my iPad On Mar 21, 2013, at 20:57, Noah Silverman noahsilver...@ucla.edu wrote: Hello, I have a large data.frame of 80,000 rows where each row is a record. Each record is indexed by a

Re: [R] Clever way to match two lists

2013-03-21 Thread Noah Silverman
Jim, That's perfect. Thanks. Also tried Neal's method, but it wound up be MUCH slower to build the index. Thanks, -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences Building Los Angeles, CA 90095 On Mar 21, 2013, at 6:07 PM, Jim Holtman jholt...@gmail.com wrote:

Re: [R] NADA

2013-03-21 Thread Janh Anni
Hello Don, Jeff, Thanks a lot for the comments and suggestions. Best Janh On Thu, Mar 21, 2013 at 10:57 AM, MacQueen, Don macque...@llnl.gov wrote: According to ?ros, one of the arguments is: reverseT: A name of a function to use for reversing the transformation after

  1   2   >