write r file to csv — “object not found”
Hello I need to make my R file into a CSV file. I have searched stackoverflow for different methods to accomplish this, but nothing is working. Each time, it says:
Error in is.data.frame(x) : object 'refine_clean' not found
My file is definitely named refine_clean.R. I have linked a screenshot here:
R Studio CSV Error Message
r export-to-csv
add a comment |
Hello I need to make my R file into a CSV file. I have searched stackoverflow for different methods to accomplish this, but nothing is working. Each time, it says:
Error in is.data.frame(x) : object 'refine_clean' not found
My file is definitely named refine_clean.R. I have linked a screenshot here:
R Studio CSV Error Message
r export-to-csv
The dataframe you want to write does not exist! Most likely, something upstream ofwrite.table()
andwrite.csv()
failed. Scan the entire script's output carefully and look for error messages.
– 12b345b6b78
Nov 10 '18 at 17:59
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save)d5
, right?
– ANG
Nov 10 '18 at 18:15
add a comment |
Hello I need to make my R file into a CSV file. I have searched stackoverflow for different methods to accomplish this, but nothing is working. Each time, it says:
Error in is.data.frame(x) : object 'refine_clean' not found
My file is definitely named refine_clean.R. I have linked a screenshot here:
R Studio CSV Error Message
r export-to-csv
Hello I need to make my R file into a CSV file. I have searched stackoverflow for different methods to accomplish this, but nothing is working. Each time, it says:
Error in is.data.frame(x) : object 'refine_clean' not found
My file is definitely named refine_clean.R. I have linked a screenshot here:
R Studio CSV Error Message
r export-to-csv
r export-to-csv
asked Nov 10 '18 at 17:57
EB GoldEB Gold
186
186
The dataframe you want to write does not exist! Most likely, something upstream ofwrite.table()
andwrite.csv()
failed. Scan the entire script's output carefully and look for error messages.
– 12b345b6b78
Nov 10 '18 at 17:59
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save)d5
, right?
– ANG
Nov 10 '18 at 18:15
add a comment |
The dataframe you want to write does not exist! Most likely, something upstream ofwrite.table()
andwrite.csv()
failed. Scan the entire script's output carefully and look for error messages.
– 12b345b6b78
Nov 10 '18 at 17:59
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save)d5
, right?
– ANG
Nov 10 '18 at 18:15
The dataframe you want to write does not exist! Most likely, something upstream of
write.table()
and write.csv()
failed. Scan the entire script's output carefully and look for error messages.– 12b345b6b78
Nov 10 '18 at 17:59
The dataframe you want to write does not exist! Most likely, something upstream of
write.table()
and write.csv()
failed. Scan the entire script's output carefully and look for error messages.– 12b345b6b78
Nov 10 '18 at 17:59
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save) d5
, right?– ANG
Nov 10 '18 at 18:15
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save) d5
, right?– ANG
Nov 10 '18 at 18:15
add a comment |
2 Answers
2
active
oldest
votes
Your file is named refine_clean but you have no data.frame or object named refine_clean, which is what write_table
and write.csv
are looking for.
based on the screen shot, it is not clear what you want to produce. If it is the last object you created (d5
), you may want something like this
write.csv(d5, "refine_clean.csv")
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
The file is saved in your working directory by default. If you want to save it in a particular folder usewrite.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
add a comment |
you cant convert all your file as an csv, you need to select the object, like d5
write.csv(d5,file = "name_of_the_file")
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241853%2fwrite-r-file-to-csv-object-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your file is named refine_clean but you have no data.frame or object named refine_clean, which is what write_table
and write.csv
are looking for.
based on the screen shot, it is not clear what you want to produce. If it is the last object you created (d5
), you may want something like this
write.csv(d5, "refine_clean.csv")
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
The file is saved in your working directory by default. If you want to save it in a particular folder usewrite.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
add a comment |
Your file is named refine_clean but you have no data.frame or object named refine_clean, which is what write_table
and write.csv
are looking for.
based on the screen shot, it is not clear what you want to produce. If it is the last object you created (d5
), you may want something like this
write.csv(d5, "refine_clean.csv")
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
The file is saved in your working directory by default. If you want to save it in a particular folder usewrite.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
add a comment |
Your file is named refine_clean but you have no data.frame or object named refine_clean, which is what write_table
and write.csv
are looking for.
based on the screen shot, it is not clear what you want to produce. If it is the last object you created (d5
), you may want something like this
write.csv(d5, "refine_clean.csv")
Your file is named refine_clean but you have no data.frame or object named refine_clean, which is what write_table
and write.csv
are looking for.
based on the screen shot, it is not clear what you want to produce. If it is the last object you created (d5
), you may want something like this
write.csv(d5, "refine_clean.csv")
answered Nov 10 '18 at 18:13
Peter_EvanPeter_Evan
2388
2388
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
The file is saved in your working directory by default. If you want to save it in a particular folder usewrite.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
add a comment |
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
The file is saved in your working directory by default. If you want to save it in a particular folder usewrite.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
ah i see what you mean. Yes, it is the last object, d5. I used your code -- thanks! -- it no longer causes an error but I also don't see a csv file created anywhere... is there another step? imgur.com/s2aKZZZ
– EB Gold
Nov 10 '18 at 18:18
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
I also tried with this refine_clean <- write.table(d5) write.csv(refine_clean, file = "refine_clean.csv")
– EB Gold
Nov 10 '18 at 18:20
1
1
The file is saved in your working directory by default. If you want to save it in a particular folder use
write.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
The file is saved in your working directory by default. If you want to save it in a particular folder use
write.csv(d5, "C:/Users/blablaPathToFolder/refine_clean.csv")
– ANG
Nov 10 '18 at 18:21
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
What @ANG said. Additionally, you can just scan your local machine for the file, such as typing "refine_clean.csv" in your File Explorer on a windows machine.
– Peter_Evan
Nov 10 '18 at 18:25
add a comment |
you cant convert all your file as an csv, you need to select the object, like d5
write.csv(d5,file = "name_of_the_file")
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
add a comment |
you cant convert all your file as an csv, you need to select the object, like d5
write.csv(d5,file = "name_of_the_file")
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
add a comment |
you cant convert all your file as an csv, you need to select the object, like d5
write.csv(d5,file = "name_of_the_file")
you cant convert all your file as an csv, you need to select the object, like d5
write.csv(d5,file = "name_of_the_file")
answered Nov 10 '18 at 18:17
Luis Miguel BaqueiroLuis Miguel Baqueiro
1
1
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
add a comment |
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
Please, could you explain how your answer is different from Peter_Evan's one?
– ANG
Nov 10 '18 at 18:22
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241853%2fwrite-r-file-to-csv-object-not-found%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The dataframe you want to write does not exist! Most likely, something upstream of
write.table()
andwrite.csv()
failed. Scan the entire script's output carefully and look for error messages.– 12b345b6b78
Nov 10 '18 at 17:59
Thank you. There was a problem reading the original csv file but it eventually worked. That was the only error. imgur.com/a/rg1ZP9z
– EB Gold
Nov 10 '18 at 18:07
refine_clean.R
is the name of your R scrip file, not the name of the file you want to export/write. It looks like you actually want to write (I mean save)d5
, right?– ANG
Nov 10 '18 at 18:15