I'm using Julia on Macbook and am having trouble importing an excel file to it.
This is what I've used but it won't work.
using XLSX
#set datafile's location
cd("/Users/myname/Desktop/cpsmar.xlsx")
xf = XLSX.readxlsx("cpsmar.xlsx")
How can I fix this?
Related
everyone! I am kinda new to R and was trying to download the Women data from the inbuilt Data set library in R. I understand that I have to use the save function to do so, but i am uncertain how.
Running:
write.csv(x = data("women"), file = "women.csv")
will save the women.csv in your working directory. You can check location by running getwd() or specify path using the file argument.
i am trying to load an excel file in r studio but each time i run it
Error in read_excel("R/win-library/3.6/IMDB_data.xlsx", sheet = "IMDB_data",
:
could not find function "read_excel" this is displayed.
i have tried changing directory
saving the data to load, in the same as working directory
none of the articles resolve my issues concerned yet
tried changing directory
saving the file in the same place as my working directory
importing through choose directory
setwd("~/R/win-library/3.6")
library(readxl)
IMDB_data <- read_excel("R/win-library/3.6/IMDB_data.xlsx",
sheet = "IMDB_data", skip = 2)
Write R code using data “IMDB_data” to
Load CSV in R by skipping second row.
enter image description here
It seems like your readxl library is not loaded.
Do you get any errors when you run library(readxl)?
Your working folder shouldn't matter and you should probably avoid working in the R's library.
The read_excel command should read the file based on the path provided, but your error is not complaining about the missing file. It's complaining about the missing function.
Lastly, if you set the working directory to ~/R/win-library/3.6, then it would be enough to run the following code (provided your readxl library loaded correctly):
IMDB_data <- read_excel("IMDB_data.xlsx", sheet = "IMDB_data", skip = 2)
Trying to figure out why I can't use read.csv to call a data file into R. I have the latest version of R. Do I need to reset my working directory?
carSpeeds <- read.csv(file = 'data/car-speeds.csv')
I need to convert an Excel file(xls/xlsx) to xpt file using R. I have downloaded and installed RStudio and R but i am unable to convert my excel file to xpt.
I have tried following thing:
downloaded "readxl" and "sasxport" packages
used "write.xport" for creating the xpt file
used "lookup.xport" for displaying the xpt file
I used SAS XPORT file viewer for viewing the xpt file but it shows some distorted output. Any help would be appreciated.
SAS studio will convert this from xlsx to xpt extension.
Need to install SAS studio and share path.
code:
libname mydata '/folders/myfolders/';
libname in xlsx "/folders/myfolders/Nike AOC form-1180808330 (2).xlsx";
libname out xport "/folders/myfolders/Nike AOC form-1180808330 (2).xpt";
proc copy inlib=in outlib=out;
run;
Thats all and it will convert to XPT.
I am doing a loop on different file and need to read a file extract the information and then delete it.
In R I use the package openxlsx
datatemp = openxlsx::read.xlsx(xlsxFile = "./source/aFile.xlsx")
However I can't remove the file from windows, it tells me it is open in R studio, I tried to point read.xlsx to another file, and to closeAllConnections but it did not work.
Is there a way to disconnect R from the file without having to close R studio ?
Thanks
Romain
I am on Windows 7 and I used unlink which let me delete the file
datatemp = openxlsx::read.xlsx(xlsxFile = "temp.xlsx")
unlink(datatemp)
Then I was able to manually delete the file without a problem