Skip to content

UPDATE

7 messages · Jeff Newmiller, Richard M. Heiberger, Spencer Brackett +1 more

#
Please always reply-all to keep the list involved.

If you used Save As to change the data format to Excel AND the file extension to xlsx, then yes, you should be able to read with readxl. I don't recommend it, though... Excel often changes data silently and in irregularly located places in your file.
On December 26, 2018 7:38:16 PM PST, Spencer Brackett <spbrackett20 at saintjosephhs.com> wrote:

  
    
#
Sorry, my mistake.

So I could still use read.table and should I try using a .txt version of
the file to avoid the silent changes you described?

Also, when I tried to simply this process by downloading the dataset onto
RStudio opposed to R (Gui) I received the following...
 library(readxl)
protein_expression.csv")
Error: Can't establish that the input is either xls or xlsx.
Error in View : object 'GBM_protein_expression' not found
Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
  cannot open compressed file
'C:/Users/Spencer/AppData/Local/Temp/RtmpQNQrMh/input147c61fc5b52.rds',
probable reason 'No such file or directory'
read_excel("C:/Users/Spencer/Desktop/GBM_protein_ expression.xlsx")
readxl works best with a newer version of the tibble package.
You currently have tibble v1.4.2.
Falling back to column name repair from tibble <= v1.4.2.
Message displays once per session.
Is this perhaps the result of lack of preview (which I did not complete at
the time I hit import as the preview failed to load), or the fact that the
excel file itself contains no numerical data, but only TRUE or FALSE
entries?

On Wed, Dec 26, 2018 at 10:59 PM Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:

  
  
#
this is wrong because the file is a csv file.  read_excel is designed
for xls files.
GBM_protein_expression <- read_excel("C:/Users/Spencer/Desktop/GBM
protein_expression.csv")

How did you get a csv? it downloads as tsv.

the statement you should use is in base, no library() statement is needed.

GBM_protein_expression <- read.delim("C:/Users/Spencer/Desktop/GBM
protein_expression.csv")

read.delim is the same as read.csv except that it sets the sep
argument to "\t".



On Wed, Dec 26, 2018 at 11:11 PM Spencer Brackett
<spbrackett20 at saintjosephhs.com> wrote:
#
Does this help Spencer? The read.delim() function assumes a tab character by default, but I specifically included it using the read.csv function. The downloaded file is NOT an Excel file so this should help. 

GBM_protein_expression <- read.csv("C:/Users/Spencer/Desktop/GBM
protein_expression.tsv", sep=?\t?)

Sent from my iPhone
#
Caitlin,

  I tried your command in both RGui and RStudio but both came up as errors.
I believe I made a mistake somewhere I labeling/downloading the files,
which is the source of the confusion in R. I will re-examine the files
saved on my desktop to determine the error. Regardless, would it be better
to use a read.table or read.csv function when attempting to download my
datasets? I tried using read.xl on RStudio as this process seemed much
easier, however, it would seem that my proclivity to error prevents such.

Best,

Spencer

On Wed, Dec 26, 2018 at 11:55 PM Caitlin Gibbons <bioprogrammer at gmail.com>
wrote:

  
  
#
Follow up,

Would read.txt also work, as I am certain that I have both datasets in .txt
files? As to a previous users question concern the .csv nature of the
supposed excel file, I am uncertain as to how this was translated as such.
The file is most certainly in excel.


On Thu, Dec 27, 2018 at 12:10 AM Spencer Brackett <
spbrackett20 at saintjosephhs.com> wrote:

            

  
  
#
Is the file being saved as .xls, .xlsx, .csv, .tsv, or .txt?


On Wed, Dec 26, 2018 at 10:14 PM Spencer Brackett <
spbrackett20 at saintjosephhs.com> wrote: