[R] Kindly Guide

@vi@e@gross m@iii@g oii gm@ii@com @vi@e@gross m@iii@g oii gm@ii@com
Fri Jul 15 03:14:44 CEST 2022

We all face  error but the difference is whether we tell us what the error
message says or assume they will know magically.

Sarcasm aside, I hope the upper case "W" was not in the code they claim they

Write.xlsx(x, "table name.xlsx")

Otherwise, I have a series of dumb questions before I can be of help.

- Are they using the "xslx" package or something else?
- Did they ever install it on that machine with install.packages("xlsx")
successfully as well as dependencies.
- Did they run this command in this session before trying it:
- Do they have a variable named x with suitable content or did they read the
manual page which mentions an x=arg, file=arg, sheetName=arg
- If they have a variable actually named x, is it of class data.frame
(perhaps also a tibble or data.table) and it is not a data.frame, either
make it into one (as in if it is something like a vector or list or matrix
if those are not automatically handled) or USE SOME OTHER FUNCTION that
handles it.
- Do they have write permission on the current folder or enough empty space
- Are you trying to append to an existing file or making a new one?
- And the big question. What was the error message and might that mean
revisiting one of the above that has not been checked already?

Once that works, you need to think carefully about whether to accept the
default sheetName or specify another or accept where it puts the data. Some
such functions allow you to specify a starting cell within the .XSLX file.

And, just FYI, in many cases you do not need to do any of this. You can save
a data.frame into a .CSV file and EXCEL can happily open that and display it
and, if you want, save it again as one of many formats including .XSLX ...

The above is not exhaustive but meant to point out that an unspecified error
(or merely the absence of an output file) is not enough to diagnose
anything.  I have had people who copied perfectly good lines of code
precisely then neglected to hit RETURN and asked why it did not work. Hard
to even imagine diagnosing that remotely without asking really silly
questions like do you know how to get the program to know when you are

I apologize if I am unkindly guiding.

-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of Ebert,Timothy Aaron
Sent: Thursday, July 14, 2022 3:51 PM
To: Muhammad Zubair Chishti <mzchishti using eco.qau.edu.pk>; r-help using r-project.org
Subject: Re: [R] Kindly Guide

I went to google and typed in "save excel in r" and got a few hits:
This is a good site, but there are others:

and many more.


-----Original Message-----
From: R-help <r-help-bounces using r-project.org> On Behalf Of Muhammad Zubair
Sent: Thursday, July 14, 2022 3:40 PM
To: r-help using r-project.org
Subject: [R] Kindly Guide

[External Email]

Dear Experts,
I have obtained the results through applying Time Varying VAR model in R.
Now I want to save my results in a excel sheet. Kindly guide me how to
create a excel or excel table. Although I have tried the following code but
I face error.
Write.xlsx(x, "table name.xlsx")

Kindly guide.


        [[alternative HTML version deleted]]

R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list