Hello. I am new to R, so my question/problem might be very basic, but I cannot figure out how to solve it. So, I would really appreciate your help. I would like to rename a variable in a very large file (181GB) called "2013.xdf" that is saved on my external hard drive. I tried running the following code to rename variable # 2 in the file and save this change, which produced some errors that I cannot resolve:> temp.data <- rxGetVarInfo("E:/2013.xdf") > temp.data[2] <- "transsactionnumber" > rxSetVarInfo(2013fixed.data, outfile)Error: unexpected symbol in "rxSetVarInfo(2013fixed.data"> rxSetVarInfo(temp.data, outfile)Error in is.data.frame(file) : object 'outfile' not found> rxSetVarInfo(outfile)Error in rxSetVarInfoXdf(varInfo, file = data) : object 'outfile' not found Please help me figure out how to do it right. Gratefully, -- Pavel A. Yakovlev, Ph.D. Associate Professor 819 Rockwell Hall Department of Economics and Finance Duquesne University 600 Forbes Avenue Pittsburgh, PA 15282 Work Phone: 412-396-1908 [[alternative HTML version deleted]]
Hi Pavel, The problem may be with the name "2013fixed.data". I don't know where that came from, but try naming it "fixed2013.data". Jim On Fri, Jan 23, 2015 at 4:53 AM, Pavel Yakovlev <pyakov01 at gmail.com> wrote:> Hello. > > I am new to R, so my question/problem might be very basic, but I cannot > figure out how to solve it. > So, I would really appreciate your help. > > I would like to rename a variable in a very large file (181GB) called > "2013.xdf" that is saved on my external hard drive. > > I tried running the following code to rename variable # 2 in the file and > save this change, which produced some errors that I cannot resolve: > >> temp.data <- rxGetVarInfo("E:/2013.xdf") >> temp.data[2] <- "transsactionnumber" >> rxSetVarInfo(2013fixed.data, outfile) > Error: unexpected symbol in "rxSetVarInfo(2013fixed.data" >> rxSetVarInfo(temp.data, outfile) > Error in is.data.frame(file) : object 'outfile' not found >> rxSetVarInfo(outfile) > Error in rxSetVarInfoXdf(varInfo, file = data) : > object 'outfile' not found > > > Please help me figure out how to do it right. > > Gratefully, > -- > > Pavel A. Yakovlev, Ph.D. > Associate Professor > 819 Rockwell Hall > Department of Economics and Finance > Duquesne University > 600 Forbes Avenue > Pittsburgh, PA 15282 > Work Phone: 412-396-1908 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi, Here is my suggestion: To change variable 2 name:>names(temp.data)[2] <- "transsactionnumber"To show all variable names to verify:>names(temp.data)______________________________________ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/need-help-with-renaming-a-variable-tp4702154p4702179.html This email was sent by JSHuang3181 (via Nabble) To receive all replies by email, subscribe to this discussion: http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=subscribe_by_code&node=4702154&code=ci1oZWxwQHItcHJvamVjdC5vcmd8NDcwMjE1NHwtNzg0MjM1NTA4 [[alternative HTML version deleted]]
Hi Pavel, I probably should have explained that an object name beginning with a number is not valid. See "An Introduction to R", section 1.8. I think that the invalid name "2013fixed.data" has somehow been generated. If you can find where this occurred and change it to "fixed2013.data" the original error should disappear. Jim On Sat, Jan 24, 2015 at 5:51 AM, Pavel Yakovlev <pyakov01 at gmail.com> wrote:> Jim, I tried as you suggested but it also did not work. Here's the error: > rxSetVarInfo(fixed2013.data, outfile) > Error in rxSetVarInfoXdf(varInfo, file = data) : > object 'fixed2013.data' not found > > On Thu, Jan 22, 2015 at 5:50 PM, Jim Lemon <drjimlemon at gmail.com> wrote: >> >> Hi Pavel, >> The problem may be with the name "2013fixed.data". I don't know where >> that came from, but try naming it "fixed2013.data". >> >> Jim >> >> >> On Fri, Jan 23, 2015 at 4:53 AM, Pavel Yakovlev <pyakov01 at gmail.com> >> wrote: >> > Hello. >> > >> > I am new to R, so my question/problem might be very basic, but I cannot >> > figure out how to solve it. >> > So, I would really appreciate your help. >> > >> > I would like to rename a variable in a very large file (181GB) called >> > "2013.xdf" that is saved on my external hard drive. >> > >> > I tried running the following code to rename variable # 2 in the file >> > and >> > save this change, which produced some errors that I cannot resolve: >> > >> >> temp.data <- rxGetVarInfo("E:/2013.xdf") >> >> temp.data[2] <- "transsactionnumber" >> >> rxSetVarInfo(2013fixed.data, outfile) >> > Error: unexpected symbol in "rxSetVarInfo(2013fixed.data" >> >> rxSetVarInfo(temp.data, outfile) >> > Error in is.data.frame(file) : object 'outfile' not found >> >> rxSetVarInfo(outfile) >> > Error in rxSetVarInfoXdf(varInfo, file = data) : >> > object 'outfile' not found >> > >> > >> > Please help me figure out how to do it right. >> > >> > Gratefully, >> > -- >> > >> > Pavel A. Yakovlev, Ph.D. >> > Associate Professor >> > 819 Rockwell Hall >> > Department of Economics and Finance >> > Duquesne University >> > 600 Forbes Avenue >> > Pittsburgh, PA 15282 >> > Work Phone: 412-396-1908 >> > >> > [[alternative HTML version deleted]] >> > >> > ______________________________________________ >> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> > https://stat.ethz.ch/mailman/listinfo/r-help >> > PLEASE do read the posting guide >> > http://www.R-project.org/posting-guide.html >> > and provide commented, minimal, self-contained, reproducible code. > > > > > -- > > Pavel A. Yakovlev, Ph.D. > Associate Professor > 819 Rockwell Hall > Department of Economics and Finance > Duquesne University > 600 Forbes Avenue > Pittsburgh, PA 15282 > Work Phone: 412-396-1908