[R] outputs of a function

2014-12-04 Thread Arnaud Michel
Hello I have a function named FctModele13 in which 1) I calculate a dataframe named Total and 2) I used ggplot2. I have the following problem. I cannot produce simultaneously * the graphic by ggplot2 * the dataframe My simplified code is the following one : TT -

[R] Error loading workspace

2014-12-04 Thread Frederico Mestre
Hello, I'm trying to load a workspace and I'm getting this error: value of 'SET_ATTRIB' must be a pairlist or NULL, not a 'double' Is there anything I can do to correct this? Cheers, Frederico Mestre [[alternative HTML version deleted]] __

[R] Using line (Tukey's robust line) on 3 observations?

2014-12-04 Thread Tal Galili
By accident I came across the following example: x - 1:3 y - 1:3 line(x, y) # returns: Call: line(x, x) Coefficients: [1] -2 2 While when using 1:4, it will give the more reasonable 0,1 coefficients. I imagine this is in the way it calculate the quantiles (i.e.: a feature). Can someone

Re: [R] lmom package - Resending the email

2014-12-04 Thread peter dalgaard
lmom is based on L-moments, which are different from ordinary moments, except for the 1st one. It would be truly miraculous if it gave the same result as the ordinary method of moments or maximum likelihood. Estimates of any distributional parameter requires that the model actually fits the

Re: [R] outputs of a function

2014-12-04 Thread Jeff Newmiller
This is a poor approach from a usability perspective... I suggest you create two separate functions rather than one. However, you seem to be missing a crucial point in the use of ggplot, which also applies to lattice graphics. These functions actually don't produce output at all... they

[R] 8 statistics course; January - June 2015

2014-12-04 Thread Highland Statistics Ltd
Apologies for cross-posting We would like to announce the following 8 statistics course covering topics such as R, data exploration (using lattice and ggplot2), multiple linear regression, GLM, GAM, mixed modelling, GLMM, GAMM, Bayesian analysis and MCMC. For further information,

Re: [R] outputs of a function

2014-12-04 Thread Arnaud Michel
Thank you Jeff and Mark for your help Michel Le 04/12/2014 15:09, Jeff Newmiller a écrit : This is a poor approach from a usability perspective... I suggest you create two separate functions rather than one. However, you seem to be missing a crucial point in the use of ggplot, which also

[R] change x-axis labels in dlnm's slices figures

2014-12-04 Thread Malgosia Lubczynska
Hello, I am using the dlnm package and I would like to change the x-axis labels in the slices figures (the figures showing associations along the range of the predictor at specific lags and along the range of lags at specific values of the predictor. I am using the following script:

Re: [R] Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)

2014-12-04 Thread David Winsemius
On Dec 3, 2014, at 7:43 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: Hello Chel and David, Thank you very much for providing new insights into this issue. Here is one more question. Why does the mutate () give incorrect results here? # The following gives INCORRECT results - mutated()ed

Re: [R] Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)

2014-12-04 Thread Jeff Newmiller
There is something weird going on with mutate's interaction with the scalar Date objects. It seems to be passing them to max as constants of mode double. Regardless, use of rowwise should be very rare, and you are definitely abusing it. Learn to work with vectors of values rather than one value

Re: [R] Getting the most recent dates in a new column from dates in four columns using the dplyr package (mutate verb)

2014-12-04 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello Jeff, Your code has given me desired results, and your advice is well taken. I agree with you regarding the use of logical indexing for testing conditions. Thank you so much for your time and advice. Pradip Pradip K. Muhuri SAMHSA/CBHSQ 1 Choke Cherry Road, Room 2-1071 Rockville, MD

[R] Question

2014-12-04 Thread Ghasemzadeh-Barvarz, Massoud
Could you please let me know whether R software has any advantage over MATLAB to analyze very big datasets? Thanks you so much [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Zilefac Elvis via R-help
Hello, I would like to rename multiple files in a directory. Filenames are read using: lfile - list.files(pattern=rcp45_Daily_) files - paste(paste(getwd(),lfile,sep=/), list.files(lfile),sep=/)# getwd of these files dput(lfile) c(rcp45_Daily_Sim001.dat, rcp45_Daily_Sim002.dat) - How can

[R] using inspect with a TermDocumentMatrix to convert to a data frame

2014-12-04 Thread Erin Hodgess
Hello! I am working through the Social Media Mining with R book and I have something that is a bit problematic. Here is the code: hash2_tdm - TermDocumentMatrix(hash2_corpus) print(hash2_tdm) print(findFreqTerms(hash2_tdm,lowfreq=10)) hash3_tdm -

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Chel Hee Lee
I put five data files (example1.dat, example2.dat, example3.dat, example4.dat, example5.dat, example6.dat) in my working directory. file_names - list.files(pattern=*.dat) file_names [1] example1.dat example2.dat example3.dat example4.dat example5.dat [6] example6.dat new_names -

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Zilefac Elvis via R-help
Hi Chel, Thanks for the timely reply. It works but a minor problem remains. Here is the modified version of your code: file_names- list.files(pattern=Sim1971-2000_Daily_) new_names - paste(rcp45_Daily_Sim,format(seq(length(file_names)), width=3, flag=00), .dat, sep=) #files -

Re: [R] Rename multiple files in a directory and write renamed files back to directory

2014-12-04 Thread Chel Hee Lee
I see that a function 'format()' is used in your code. format(c(1,5,32,100), width=3, flag=0) [1] 1 5 32 100 formatC(c(1,5,32,100), width=3, flag=0) [1] 001 005 032 100 I hope this helps. Chel Hee Lee On 12/04/2014 10:54 PM, Zilefac Elvis wrote: Hi Chel, Thanks for the timely reply.

Re: [R] using inspect with a TermDocumentMatrix to convert to a data frame

2014-12-04 Thread Wush Wu
Dear Erin, For the issue of printing big data.frame, you could define a customized `print.data.frame` in the user environment to prevent R prints all the data. For example: ```r print.data.frame - function(df) { base::print.data.frame(head(df)) cat(===\n) base::print.data.frame(tail(df))

[R] I am trying to use assign and paste to assign value to existing variable

2014-12-04 Thread Dirkse van Schalkwyk, Theuns the...@sun.ac.za
In the code below, the last line of code does what I am trying to do; however, I do not know the name of the variable before the user creates it, by choosing values in Route1. So, how can I assign values to the variables individually, when I created them using the code in lines 9-12 and

Re: [R] lmom package - Resending the email

2014-12-04 Thread Katherine Gobin
Dear Dalgaard sir, Thanks a lot for detailed clarification. It indeed is very enlightening and will be very useful for me in future. And your suggestion is well taken. Thanks again. Regards Katherine On Thu, 4/12/14, peter dalgaard

[R] 2 ablines dans 1 même plot vide

2014-12-04 Thread Adrien Bonvin
Bonjour J’aimerais savoir comment créer un “plot vide”, dans lequel je pourrais ajouter deux valeurs d’abline, tracées à partir de deux nuages de points différents (que je souhaiterais ne pas voir dans mon graphique final). Comme résultat final je voudrais donc avoir un plot ne contenant que

[R] Plot gamma distribution with relative frequency histogram

2014-12-04 Thread dila radi
Dear R users, I am looking to fit a gamma curve onto a histogram of the data. Consider dt1 as my data: c(203.9, 91.5, 24.5, 34.5, 164, 144, 160.5, 195, 191.5, 189, 133, 110.5, 155, 80.5, 250.5, 116, 145, 118.5, 406, 183.5, 142.5, 197, 367, 134, 153.5) I am using this code in R x-dt1

[R] building generic regression tool - error invalid type (list) for variable

2014-12-04 Thread Brianna Noland
Hello, First I apologize in advance for for my limited knowledge of R. For an R course I am writing a generic tool which will execute models based on inputs. When I attempt to run one of the input models, I get the error: invalid type (list) for variable 'MPG' which has been described here:

Re: [R-es] Resumen de R-help-es, Vol 70, Envío 3

2014-12-04 Thread Javier Villacampa González
Felicidades, la charla es sublime. Muy util. Estoy deseando echarle un diente al código. El 4 de diciembre de 2014, 12:00, r-help-es-requ...@r-project.org escribió: Envíe los mensajes para la lista R-help-es a r-help-es@r-project.org Para subscribirse o anular su subscripción a