[R] Changing text file to .r format

2015-11-06 Thread Chattopadhyay, Somsubhra
Dear all, I am a beginner in R and want to ask a simple question. I have a code file in text format which I need to change to .r format only. For example now it is RHtestsV4.r.txt which needs to be changed to just RHtestsV4.r. I tried this sub("^([^.]*).*", "\\1", 'RHtestsV4.r.txt') [1]

Re: [R] Changing text file to .r format

2015-11-06 Thread Henrik Bengtsson
My guess is that your on Windows. If so, make sure to change settings in Explorer to always show filename extensions, because now I think it drops .txt when it lists/displays your files (this is one of the most annoying features in Windows). Also, some basic editors add .txt extension when you

Re: [R] Changing text file to .r format

2015-11-06 Thread Pascal Oettli via R-help
For reference, also asked here: http://stackoverflow.com/questions/33569737/unable-to-call-a-function-in-r On Sat, Nov 7, 2015 at 4:22 AM, Chattopadhyay, Somsubhra wrote: > Dear all, > > I am a beginner in R and want to ask a simple question. I have a code file > in text

Re: [R] Changing text file to .r format

2015-11-06 Thread Jeff Newmiller
Perhaps this would be a good time to use your operating system capabilities to change the name of the file. All you have been doing is mucking with data in R without affecting the actual file name. --- Jeff Newmiller

Re: [R] Changing text file to .r format

2015-11-06 Thread Spencer Boucher
There is no fundamental difference between an .R file and a .txt file. They are both just text files; all you are doing is changing the name. This Stack Overflow question shows how to use `file.rename` to do so. http://stackoverflow.com/a/10759083/1850696. Chattopadhyay, Somsubhra writes: