Re: [R] How to read from a file within a gzipped file

2021-10-11 Thread Rui Barradas
Hello, You can create a connection and read from it. desc <- "X:/Mkt Science/Projects/ tv/202109.ext/tsa.20210901.xml.zip" fname <- "20210901.socioDemos.a.xml" zz <- unz(desc, fname) Now read from zz. Example: xml <- XML::xmlParse(zz) Hope this helps, Rui Barradas Às 17:24 de 11/10/21, C

Re: [R] How to read from a file within a gzipped file

2021-10-11 Thread Ivan Krylov
On Mon, 11 Oct 2021 16:24:01 + "Conklin, Mike (GfK) via R-help" wrote: > Is there a way to return a connection to a single file within a > zipped file using gzfile or some other method. Sure! Use unz() instead of gzfile(). -- Best regards, Ivan

[R] How to read from a file within a gzipped file

2021-10-11 Thread Conklin, Mike (GfK) via R-help
Hi have a large number of zipped files, each containing 3 xml files that I want to read. I would like to read one of the xml files without having to decompress each zip file first. If I run gzfile(path2zipped file) I get A connection with description "X:/Mkt Science/Projects/ tv/202109.ext/t

Re: [R] How to read a shapefile with areas other than the one used by default in the spplot?

2020-03-25 Thread Bert Gunter
1. Wrong list. You should post on r-sig-geo instead. 2. As you use ggplot, why aren't you using ggmap() ? Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, M

[R] How to read a shapefile with areas other than the one used by default in the spplot?

2020-03-25 Thread Yana Borges
Hello! I send the same question I asked in the stackoverflow, if you don't mind. It is possible that it is something simple, but I really did not succeed. I need to make a map as it is in the script I send below. The shapefile I am using, as well as the data, are attached. My problem: I want the d

Re: [R] how to read a database in R?

2020-02-01 Thread John Kane
What happens if you run "dbListTables(db) "? That is a warning not an error. I am a real novice with data bases so I may not be of much help but do you know where the db file came from? When I suggested the code above. i checked that ii worked on a sqlite file I had, and hoped that Ivan's miracul

Re: [R] how to read a database in R?

2020-02-01 Thread Ana Marija
Hi John, I tried it but this is what I got: > library(RSQLite) > filename <- "DGN-WB_0.5.db" > sqlite.driver <- dbDriver("SQLite") > db <- dbConnect(sqlite.driver, + dbname = filename) Warning message: Couldn't set synchronous mode: disk I/O error Use `synchronous` = NULL to turn

Re: [R] how to read a database in R?

2020-02-01 Thread John Kane
Hi Ana Stolen from https://gist.github.com/jwolfson/72bc7d7fd8d339955b38 I cannot remember if you will need to install any other packages besides RSQLite library(RSQLite) filename <- "your_db_file.db" sqlite.driver <- dbDriver("SQLite") db <- dbConnect(sqlite.driver, dbname = filen

Re: [R] how to read a database in R?

2020-02-01 Thread Ana Marija
Hi Ivan Thanks for getting back to me. Can you please share with me some code I would use to see what is in my database? On Sat, 1 Feb 2020 at 06:19, Ivan Krylov wrote: > On Fri, 31 Jan 2020 17:02:16 -0600 > Ana Marija wrote: > > > I have a database DGN-WB_0.5.db is there is a way to explore i

Re: [R] how to read a database in R?

2020-02-01 Thread Ivan Krylov
On Fri, 31 Jan 2020 17:02:16 -0600 Ana Marija wrote: > I have a database DGN-WB_0.5.db is there is a way to explore its > content in R? My psychic debugging powers tell me that it's an SQLite database, so the answer to your question is: yes, it should be possible to both find out the schema and

Re: [R] how to read a database in R?

2020-01-31 Thread Hasan Diwan
Ms Marija, Would you happen to know which program created it? If not, you can try the Unix file command, if you have access to that. -- H [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

Re: [R] how to read a database in R?

2020-01-31 Thread Jeff Newmiller
Too little information to tell. I googled the file name though and pages about genetics came up... perhaps you should ask in the Bioconductor support area. On January 31, 2020 3:02:16 PM PST, Ana Marija wrote: >Hello, > >I have a database DGN-WB_0.5.db is there is a way to explore its >content

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Berry, Charles
> On Jan 31, 2020, at 1:04 AM, Emmanuel Levy wrote: > > Hi, > > I'd like to use the Netflix challenge data and just can't figure out how to > efficiently "scan" the files. > https://www.kaggle.com/netflix-inc/netflix-prize-data > > The files have two types of row, either an *ID* e.g., "1:" ,

[R] how to read a database in R?

2020-01-31 Thread Ana Marija
Hello, I have a database DGN-WB_0.5.db is there is a way to explore its content in R? I don't know anything about this data base. Thanks Ana __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Emmanuel Levy
Hi All, Thanks so much for your inputs, it's so nice to have such a helpful community -- I wrote some kind of mix between the different replies, I copy my final code below. All the best, Emmanuel mat = read.csv("~/format_test.csv", fill=TRUE, header=FALSE, as.is=TRUE) first.col.idx = grep(":",

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Jan Galkowski
With the *data.table* package, *R* can use *fread* as follows: > grab<- function(file) > { > fin<- fread(file=file, > sep=NULL, > dec=".", > quote="", nrows=Inf, header=FALSE, > stringsAsFactors=FALSE, verbose=FALSE, > col.names=c("record"), > check.names=FALSE, fill=FALSE, blank.lines.skip

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Chris Evans
e ways to do this! Very best all, Chris - Original Message - > From: "Rainer M Krug" > To: "Emmanuel Levy" > Cc: "R-help Mailing List" > Sent: Friday, 31 January, 2020 10:55:46 > Subject: Re: [R] How to read a file containing two types of rows -

Re: [R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Rainer M Krug
I did something similar yesterday… Use readLine() to read at in and identify the “*1:*, … with a regex. Than you have your dividers. In a second step, use read.csv(skip = …, Ncollumns = …) to read the enclosed blocks, and last, combine them accordingly. This is written without an R installatio

[R] How to read a file containing two types of rows - (for the Netflix challenge data format)

2020-01-31 Thread Emmanuel Levy
Hi, I'd like to use the Netflix challenge data and just can't figure out how to efficiently "scan" the files. https://www.kaggle.com/netflix-inc/netflix-prize-data The files have two types of row, either an *ID* e.g., "1:" , "2:", etc. or 3 values associated to each ID: The format is as follows:

Re: [R] how to read this kind of csv in R?

2019-10-07 Thread Rui Barradas
Hello, OK, I had some spare time. Try readCSVFile <- function(filename){ lns <- readLines(filename) lns <- lns[sapply(lns, nchar) > 0] lns <- gsub(" ", "", lns) lns <- sub(";$", "", lns) i_title <- grep("[[:alpha:]]", lns) blocks <- lapply(seq_along(i_title)[-1], function(i){

Re: [R] how to read this kind of csv in R?

2019-10-07 Thread pauluo via R-help
The csv file is exported from Windows (dos format), so the line break is different from Unix. 在 星期一, 07 十月 2019 01:18:54 -0700 撰写 > I am mad about importing this strange csv format type. > > The real csv has been attached now. The raw data points are huge. > > Many thanks. >

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread Rui Barradas
Hello, It is not clear if all files have * a first block with just one data line * all other blocks with as many rows as the numbers in that first data line. If yes, maybe something like this? lns <- readLines("strange.csv") lns <- lns[sapply(lns, nchar) > 0] lns <- sub(",$", "", lns) i_title

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread Duncan Murdoch
On 06/10/2019 8:23 a.m., vod vos wrote: The problem is aa, bb and cc all in a single csv file contains no blank line. So what steps do you need, and which of them do you need help with? Duncan Murdoch The single csv file like list output. aa(cm) 1, 2 , 3, bb(mm) 1, 2, 3, 4, 5, 6,

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread vod vos via R-help
The problem is aa, bb and cc all in a single csv file contains no blank line. The single csv file like list output. aa(cm) 1, 2 , 3, bb(mm) 1, 2, 3, 4, 5, 6, 7, 8, 9, cc(mm) 3, 4, 5, 7, 5, 9, 6, 5, 8, 在 星期日, 06 十月 2019 05:08:41 -0700 Duncan Murdoch 撰写 > On 06/10/2019 7:

Re: [R] how to read this kind of csv in R?

2019-10-06 Thread Duncan Murdoch
On 06/10/2019 7:29 a.m., vod vos via R-help wrote: I got hundreds of csv files. The real formats in each csv file are as follows: aa(cm) 1, 2 , 3, bb(mm) 1, 2, 3, 4, 5, 6, 7, 8, 9, cc(mm) 3, 4, 5, 7, 5, 9, 6, 5, 8, How can I use read.table or read.csv to convert the csv files to a tidy data f

[R] how to read this kind of csv in R?

2019-10-06 Thread vod vos via R-help
I got hundreds of csv files. The real formats in each csv file are as follows: aa(cm) 1, 2 , 3, bb(mm) 1, 2, 3, 4, 5, 6, 7, 8, 9, cc(mm) 3, 4, 5, 7, 5, 9, 6, 5, 8, How can I use read.table or read.csv to convert the csv files to a tidy data frame format as follow: aa, bb, cc 1, 1, 3 1, 2, 4 1

[R] how to read association of variable in multiple outcomes using MCMCMGLMM

2018-11-15 Thread Victor Chikwapulo
Dear all, I am  using package MCMCglmm and I would like to request for an assistant on  what to look   in the output which can tell me  whether there is significant  association among the three antibody titers(logiga,logigm,logigg)  for example association between antibody titers and exposure I ca

[R] How to read PMML data from a text file and convert it to a model ?

2017-11-15 Thread Ashim Kapoor
Dear All, I want to save the XML representation of a model using PMML. Then I want to read the model and predict using the model and a new dataset. This is described in this blog post : https://www.r-bloggers.com/predictive-modeling-using-r-and-the-openscoring-engine-a-pmml-approach/ I am able

Re: [R] How to read prediction intervals given by predict()?

2016-10-15 Thread Jeff Newmiller
No, you need to specify the inputs corresponding to the next value in order to obtain a production for that point. Read ?predict.lm or whatever function is appropriate for your model about the newdata argument. -- Sent from my phone. Please excuse my brevity. On October 15, 2016 8:24:35 AM PDT

Re: [R] How to read prediction intervals given by predict()?

2016-10-15 Thread Rolf Turner
On 16/10/16 04:24, mviljamaa wrote: My conception of prediction intervals is the following: "a prediction interval gives an interval within which we expect next y_i to lie with a specified probability" So when using predict() for my model: predict(fit4, interval="prediction")[1:20,] I get:

[R] How to read prediction intervals given by predict()?

2016-10-15 Thread mviljamaa
My conception of prediction intervals is the following: "a prediction interval gives an interval within which we expect next y_i to lie with a specified probability" So when using predict() for my model: predict(fit4, interval="prediction")[1:20,] I get: fit lwr upr 1 491

Re: [R] How to read a grib2 file

2016-09-14 Thread Michael Sumner
On Wed, 14 Sep 2016 at 00:49 Debasish Pai Mazumder wrote: > Hi Mike, > Thanks again. I am using Mac OS > > Here is the required info > > > sessionInfo() > R version 3.2.4 (2016-03-10) > Platform: x86_64-apple-darwin13.4.0 (64-bit) > Running under: OS X 10.11.6 (El Capitan) > > locale: > [1] en_US

Re: [R] How to read a grib2 file

2016-09-13 Thread Debasish Pai Mazumder
Hi Mike, Thanks again. I am using Mac OS Here is the required info > sessionInfo() R version 3.2.4 (2016-03-10) Platform: x86_64-apple-darwin13.4.0 (64-bit) Running under: OS X 10.11.6 (El Capitan) locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:

Re: [R] How to read a grib2 file

2016-09-13 Thread Michael Sumner
What is your computer system? What is the output of this? sessionInfo() If you point to a file I'll try it so I can tell you the minimum system requirements. Cheers, Mike On Tue, 13 Sep 2016, 08:56 Debasish Pai Mazumder wrote: > Thanks for your suggestion. I have checked and I don't have JPEG

Re: [R] How to read a grib2 file

2016-09-12 Thread Debasish Pai Mazumder
Thanks for your suggestion. I have checked and I don't have JPEG2000 in ggdalDrivers()). I am pretty new in R. I don't understand how to do I implement JPEG2000 (JP2OpenJPEG driver) in gdalDrivers() so that I can read grib2 files with regards -Deb On Sat, Sep 10, 2016 at 2:33 AM, Michael Sumner

Re: [R] How to read a grib2 file

2016-09-10 Thread Michael Sumner
On Sat, 10 Sep 2016 at 07:12 Debasish Pai Mazumder wrote: > Hi > I am trying to read a grib2 file in R. > > Here is my script > > library(rgdal) > library(sp) > library(rNOMADS) > gribfile<-"tmax.01.2011040100.daily.grb2" > grib <- readGDAL(gribfile) > > I am getting following error : > > dec_jpe

[R] How to read a grib2 file

2016-09-09 Thread Debasish Pai Mazumder
Hi I am trying to read a grib2 file in R. Here is my script library(rgdal) library(sp) library(rNOMADS) gribfile<-"tmax.01.2011040100.daily.grb2" grib <- readGDAL(gribfile) I am getting following error : dec_jpeg2000: Unable to open JPEG2000 image within GRIB file. Is the JPEG2000 driver availa

Re: [R] How to read DiCOM images using R?

2016-02-17 Thread Sarah Goslee
Searching for DICOM at www.rseek.org turns up a few options for working with that image format. But with no idea of what you want to do with them, we can't help with the analysis. You will need to develop some clear objectives, do some reading in how you might use R to accomplish those objectives,

[R] How to read DiCOM images using R?

2016-02-17 Thread vidu pranam
Hai, I have some DICOM format images for my project. Can you please help me how can I read it by using R and how to analyse the images? Regards Vidu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

Re: [R] How to read ./configure messages

2016-02-02 Thread Patrick Connolly
Thanks Peter. That certainly got me past that one, (Few more to go) On Mon, 01-Feb-2016 at 09:30PM -0800, Peter Langfelder wrote: |> I am not overly familar with Mint, but you need the "development |> version" of the readline library. If you have a GUI package manager |> installed, open it and

Re: [R] How to read ./configure messages

2016-02-01 Thread Peter Langfelder
I am not overly familar with Mint, but you need the "development version" of the readline library. If you have a GUI package manager installed, open it and search for readline. You should see a version that ends with -dev or -devel; you need to install that. HTH, Peter On Mon, Feb 1, 2016 at 3:0

[R] How to read ./configure messages

2016-02-01 Thread p_connolly
I've installed R from the tgz file since about R-0.9.x following the INSTALL instructions and have always succeeded using rpm-based OSes. With each new OS, that involved installing various additional packages before the configure script would complete. Figuring out which packages were required u

Re: [R] How to read CSV from web?

2015-09-14 Thread Gabor Grothendieck
Your read.csv call works for me under Windows on "R version 3.2.2 Patched (2015-08-25 r69180)" but not on "R version 3.1.3 Patched (2015-03-16 r68169)". Suggest you upgrade your R installation and try again. If you are on Windowsw and don't want to upgrade right now an alternative is to issue th

Re: [R] How to read CSV from web?

2015-09-13 Thread Ryan Shuell
Also, you should bookmark this link. http://www.r-bloggers.com/this-r-data-import-tutorial-is-everything-you-need/ On Wednesday, July 29, 2015 at 6:41:35 AM UTC-4, jpara3 wrote: > > data<-read.csv(" > https://raw.githubusercontent.com/sjkiss/Survey/master/mlogit.out.csv",header=T,sep=",";) >

Re: [R] How to read CSV from web?

2015-09-13 Thread Ryan Shuell
How about this? library(XML) library(RCurl) url <- "https://raw.githubusercontent.com/sjkiss/Survey/master/mlogit.out.csv"; urldata <- getURL(url) data <- readHTMLTable(urldata, stringsAsFactors = FALSE) On Wednesday, July 29, 2015 at 6:41:35 AM UTC-4, jpara3 wrote: > > data<-read.csv("

Re: [R] How to read CSV from web?

2015-07-29 Thread jpara3
data<-read.csv("https://raw.githubusercontent.com/sjkiss/Survey/master/mlogit.out.csv",header=T,sep=",";) -- View this message in context: http://r.789695.n4.nabble.com/How-to-read-CSV-from-web-tp4710502p4710513.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] how to read a local JSON file

2015-06-07 Thread Prof Brian Ripley
On 07/06/2015 08:10, Berend Hasselman wrote: On 07-06-2015, at 07:50, Ye Lin wrote: Hi All, I downloaded a data file from dropbox and its in JSON format. here is my code: library(RJSONIO) data <- fromJSON(file='C:/Users/Downloads/sample.json') Lines <- readLines("C:/Users/Downloads/sample.j

Re: [R] how to read a local JSON file

2015-06-07 Thread Berend Hasselman
> On 07-06-2015, at 07:50, Ye Lin wrote: > > Hi All, > > I downloaded a data file from dropbox and its in JSON format. > > here is my code: > library(RJSONIO) > data <- fromJSON(file='C:/Users/Downloads/sample.json') > Lines <- readLines("C:/Users/Downloads/sample.json") > df <- as.data.frame(

Re: [R] how to read a local JSON file

2015-06-06 Thread Jim Lemon
Hi Ye Lin, Looks like the file was read, but there is no linefeed at the end of the last line. You could probably stick one in using a text or hex editor and you won't get the warning. Jim On Sun, Jun 7, 2015 at 3:50 PM, Ye Lin wrote: > Hi All, > > I downloaded a data file from dropbox and its

[R] how to read a local JSON file

2015-06-06 Thread Ye Lin
Hi All, I downloaded a data file from dropbox and its in JSON format. here is my code: library(RJSONIO) data <- fromJSON(file='C:/Users/Downloads/sample.json') Lines <- readLines("C:/Users/Downloads/sample.json") df <- as.data.frame(t(sapply(Lines, fromJSON))) I got this error message: incomplet

Re: [R] How to read this Rpart decision tree?

2015-02-11 Thread Sarah Goslee
Hi Kim fancyRpartPlot is a front-end to prp, and you can pass it all of the prp options - it says this in the help for fancyRpartPlot, and that's about all it says. So you need to spend some time reading about prp options, and how to customize your plot to get what you want. There are lots of det

Re: [R] How to read this Rpart decision tree

2015-02-11 Thread Therneau, Terry M., Ph.D.
First: summary(ss.rpart1) or summary(ss.rpart, file="whatever") The printout will be quite long since your tree is so large, so the second form may be best followed by a perusal of the file with your favorite text editor. The file name of "whatever" above should be something you choose, of

[R] How to read this Rpart decision tree?

2015-02-11 Thread Kim C.
Hi all, In the attachment or this link (http://oi58.tinypic.com/35ic9qc.jpg) you'll find the decision tree I made. I used the Rpart package to make the tree and the rattle package using the fancyRpartPlot to plot it. The data in the tree looks different than about every example I have seen bef

Re: [R] How to read tif format file?

2014-10-19 Thread Michael Sumner
What's wrong is that readGDAL tries to allocate all the memory required and build an object to essentially replace the file, and your machine cannot provide sufficient resources for that. GDAL.open provides an open connnection to the file that can be queried in different ways to read parts of the f

[R] How to read tif format file?

2014-10-19 Thread PO SU
Dear expeRts,    I want to read a  a.tif file into  R.  When i  try this: readGDAL("a.tif"), i get the following error: a.tif has GDAL driver GTiff  and has 7200 rows and 7200 columns error: can't allocate 395.5 mb vector but i can GDAL.open("a.tif") it. SO what's wrong with readGDAL? --

Re: [R] how to read data

2014-01-29 Thread William Dunlap
e path. Bill Dunlap TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Vortex > Sent: Wednesday, January 29, 2014 9:22 AM > To: r-help@r-project.org > Subject: Re: [R] how to

Re: [R] how to read data

2014-01-29 Thread Vortex
chke1993 wrote > I don't know the meaning of sep="",and don't know where to add the > location of the file such as E//... sep="" means the data you are reading is separated by a white/blank space. sep="," would mean it is separated by a comma (,). If the file is located in your working direct

Re: [R] How to read this data correctly

2014-01-25 Thread jim holtman
Try XLConnect. It seems to read the data in just fine. Did have to create a named region, otherwise it would just read in the area that had data. > require(XLConnect) > wb <- loadWorkbook("C:\\Users\\Owner\\Downloads\\Book1 (1).xlsx") > x <- readWorksheet(wb, 1, header = FALSE) # without region

Re: [R] How to read this data correctly

2014-01-24 Thread Marc Schwartz
Hi, I don't know that it is a problem in R reading the file per se. It is more of an issue, as far as I can see, that read.xls() is not written to deal with some aspects of cell formatting of certain types. In this case, the cell is formatted using a financial format with Japanese Yen. I did no

Re: [R] How to read this data correctly

2014-01-24 Thread arun
Hi, I am getting this: read.xls("Book1.xlsx",1,header=F) #  V1 #1 -0.4195477 #2 -0.4195477 sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-unknown-linux-gnu (64-bit) attached base packages: [1] stats graphics  grDevices utils datasets  methods   base other attac

Re: [R] How to read this data correctly

2014-01-24 Thread Rui Barradas
^Hello, Inline. Em 24-01-2014 20:49, Christofer Bogaso escreveu: Hi Rui, Thanks for your reply. However why you said, 'shouldn't read properly in R'? I've said this because I don't know if a cell with a formula can be read in R. Also, because when I've opened it in excel, there was some st

Re: [R] How to read this data correctly

2014-01-24 Thread Christofer Bogaso
Hi Rui, Thanks for your reply. However why you said, 'shouldn't read properly in R'? Basically I was looking for some way so that I would get -0.419547704894512 value in R against cell F4 & F7. Because F7 is linked with F4. Ofcourse I can open Excel file then format that cell accordingly. Howev

Re: [R] How to read this data correctly

2014-01-24 Thread Rui Barradas
Hello, Cell F7 has a formula, =F4, and when I open the file in excel, I get -¥0.42, which shouldn't read properly in R. The problem seems to be in the file, not in read.xls. Hope this helps, Rui Barradas Em 24-01-2014 19:22, Christofer Bogaso escreveu: Hi again, I need to read below xlsx

[R] How to read this data correctly

2014-01-24 Thread Christofer Bogaso
Hi again, I need to read below xlsx file correctly (available here: http://snk.to/f-ch3exae5), and used following code (say, file is saved in F: drive) > library(gdata) > read.xls("f:/Book1.xlsx", 1, header = F) V1 1 -0.419547704894512 2 -[$Â¥-411]0.42 However please noti

Re: [R] how to read file into terminal?

2013-12-14 Thread Uwe Ligges
See ?source Uwe Ligges On 14.12.2013 12:22, 水静流深 wrote: there is a file which contain such lines: test <-function(x,f){ n<- length(x); sum(f*(x[1:(n-1)]+x[2:n])/2)/sum(f) -> result; return(result); } i can read it into terminal , cat test.R how can i do it in R? readLines("

[R] how to read file into terminal?

2013-12-14 Thread ????????
there is a file which contain such lines: test <-function(x,f){ n<- length(x); sum(f*(x[1:(n-1)]+x[2:n])/2)/sum(f) -> result; return(result); } i can read it into terminal , cat test.R how can i do it in R? > readLines("c:/test.R",n=-1) [1] "test <-function(x,f){"

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Ista Zahn
I don't think you need admin rights to install R packages. Did you try it? Best, Ista On Wed, Sep 11, 2013 at 9:01 AM, Charles Thuo wrote: > how can one read data from MSEXcel into R especially in a case where one > does not have administrator rights to install additional packages. In short > ho

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Gabor Grothendieck
On Wed, Sep 11, 2013 at 9:06 AM, Charles Determan Jr wrote: > If there isn't multiple sheets you can use the 'gdata' package and > read.xls(). > > Otherwise you could re-save the file as a csv file and load that file with > read.csv() assuming not multiple sheets again which a csv cannot contain.

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Jeff Newmiller
The assertion that you need administrator privileges to install packages is false. You can install them into a directory under your Documents directory for your own use. You only need a administrator privileges to modify the packages located in the software installation directory. --

Re: [R] how to read data from MSExcel into R

2013-09-11 Thread Charles Determan Jr
If there isn't multiple sheets you can use the 'gdata' package and read.xls(). Otherwise you could re-save the file as a csv file and load that file with read.csv() assuming not multiple sheets again which a csv cannot contain. Regards, Charles On Wed, Sep 11, 2013 at 8:01 AM, Charles Thuo wro

[R] how to read data from MSExcel into R

2013-09-11 Thread Charles Thuo
how can one read data from MSEXcel into R especially in a case where one does not have administrator rights to install additional packages. In short how to read data from MSExcel into R with base packages only. [[alternative HTML version deleted]] _

Re: [R] How to read a .rar file in R

2013-06-09 Thread Prof Brian Ripley
On 09/06/2013 11:58, Deb Midya wrote: Hi, Thanks in advance. May I request you to assist me for the following please. I am using R-3.0.1 on Windows. Is there any R package or R function to read a .rar file (file with an extension rar)? Use system() with however you unpack rar files on your

[R] How to read a .rar file in R

2013-06-09 Thread Deb Midya
Hi,   Thanks in advance.   May I request you to assist me for the following please.   I am using R-3.0.1 on Windows.   Is there any R package or R function to read a .rar file (file with an extension rar)?   Once again, thank you very much for the time you have given.   Regards,   Deb [[al

Re: [R] How to read a file including strings and numbers.

2013-06-01 Thread Rui Barradas
Hello, Just use ?read.csv with argument header = FALSE. wnd_data <- read.csv(text = ' "2012-08-07 00:00:00",4174830,5,8.1,34.5,9.5,32,14 "2012-08-07 00:00:01",4174831,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:02",4174832,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:03",4174833,5,8.5,34.5,9.8,30,14 "

Re: [R] How to read a file including strings and numbers.

2013-06-01 Thread Jinsong Zhao
On 2013/6/1 15:54, Jie Tang wrote: hi R-users, I have a file as shown below,and the first column is time information. "2012-08-07 00:00:00",4174830,5,8.1,34.5,9.5,32,14 "2012-08-07 00:00:01",4174831,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:02",4174832,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:

[R] How to read a file including strings and numbers.

2013-06-01 Thread Jie Tang
hi R-users, I have a file as shown below,and the first column is time information. "2012-08-07 00:00:00",4174830,5,8.1,34.5,9.5,32,14 "2012-08-07 00:00:01",4174831,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:02",4174832,4.7,8.6,34.5,9.9,29,14 "2012-08-07 00:00:03",4174833,5,8.5,34.5,9.8,30,14 "2012

Re: [R] how to read numeric vector as factors using read.table.ffdf

2013-05-08 Thread MacQueen, Don
Please read the posting guide. Your question is far from clear. First you're apparently unhappy because character vectors are being converted to factors. Then later you ask how to tell a function that some numeric datas should be considered factors. Which is it that you want? A simple short exampl

[R] how to read numeric vector as factors using read.table.ffdf

2013-05-07 Thread li li
I have a big data set that includes character variables of many different values. I'm trying to use ff to read the data and then use biglm.big.matrix to build linear models. However, since big.matrix will convert all character vectors to factors and the character labels will be lost. I decided to c

Re: [R] How to read a direct access file by connecting fortran with R ?

2013-04-19 Thread Kaptue Tchuente, Armel
Behalf Of Suzen, Mehmet Sent: Friday, April 19, 2013 3:17 AM To: Kaptue Tchuente, Armel Subject: Re: [R] How to read a direct access file by connecting fortran with R ? On 19 April 2013 07:05, Kaptue Tchuente, Armel wrote: > Hello all, > > I would like to read the specific line number ro

[R] How to read a direct access file by connecting fortran with R ?

2013-04-18 Thread Kaptue Tchuente, Armel
Hello all, I would like to read the specific line number row of a direct access file (which is stored as a n_row*n_col matrix of elements kind=p) without reading all the preceding lines (i.e 1,2,..,row-1). Is there a function in R that can perform this task? To solve my issue, I tried without

Re: [R] How to read a *.csv file in R?

2013-03-13 Thread John Kane
e Kingston ON Canada > -Original Message- > From: e0928...@student.tuwien.ac.at > Sent: Wed, 13 Mar 2013 00:14:58 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] How to read a *.csv file in R? > > Hey guys, > > I am dealing with this kind of data. To read the

Re: [R] How to read a *.csv file in R?

2013-03-13 Thread peter dalgaard
On Mar 13, 2013, at 16:54 , Daniel Nordlund wrote: >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Maximus >> Sent: Wednesday, March 13, 2013 12:15 AM >> To: r-help@r-project.org >> Subj

Re: [R] How to read a *.csv file in R?

2013-03-13 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Maximus > Sent: Wednesday, March 13, 2013 12:15 AM > To: r-help@r-project.org > Subject: [R] How to read a *.csv file in R? > > Hey guys, > > I am

[R] How to read a *.csv file in R?

2013-03-13 Thread Maximus
Hey guys, I am dealing with this kind of data. To read the file in R I have nulled all empty fields and tried: dateBRENT BRENTchgHWWIHWWIchg Jan. 86 22,5NULL68,1-15,6 Feb.86 17 NULL64,9-21,6 Mar. 86 13,7NULL66,6-19,5 Apr.86 12,3NULL

Re: [R] how to read a website with Chinese Character

2013-01-23 Thread Hui Du
Sent: Wednesday, January 23, 2013 6:16 PM To: Hui Du Cc: r-help@r-project.org Subject: Re: [R] how to read a website with Chinese Character On 13-01-23 8:19 PM, Hui Du wrote: > Hi all, > > I am planning to parse some information on a website which includes lots of > Chinese char

Re: [R] how to read a website with Chinese Character

2013-01-23 Thread Duncan Murdoch
On 13-01-23 8:19 PM, Hui Du wrote: Hi all, I am planning to parse some information on a website which includes lots of Chinese characters. Does someone know how to read/display Chinese in R? Thanks. url = "http://www.teec.org.cn/html/renwujieshao/"; x = readLines(url) If you look at the fir

[R] how to read a website with Chinese Character

2013-01-23 Thread Hui Du
Hi all, I am planning to parse some information on a website which includes lots of Chinese characters. Does someone know how to read/display Chinese in R? Thanks. url = "http://www.teec.org.cn/html/renwujieshao/"; x = readLines(url) I tried encoding = 'UTF-8' already but it didn't help. My R

Re: [R] how to read a df like that and transform it?

2013-01-23 Thread arun
NA A.K. - Original Message - From: Yao He To: R help Cc: Sent: Wednesday, January 23, 2013 7:42 AM Subject: [R] how to read a df like that and transform it? Dear all I have a data.frame like that : father    mother    num_daughter    daughter 291    3906    0    NULL 2

Re: [R] how to read a df like that and transform it?

2013-01-23 Thread arun
  NA NA NA A.K. - Original Message ----- From: Yao He To: R help Cc: Sent: Wednesday, January 23, 2013 7:42 AM Subject: [R] how to read a df like that and transform it? Dear all I have a data.frame like that : father    mother    num_daughter    daughter 291    390

Re: [R] how to read a df like that and transform it?

2013-01-23 Thread arun
","mother"),timevar="num_daughter",direction="wide") A.K. - Original Message - From: Yao He To: R help Cc: Sent: Wednesday, January 23, 2013 7:42 AM Subject: [R] how to read a df like that and transform it? Dear all I have a data.frame like that : f

Re: [R] how to read a df like that and transform it?

2013-01-23 Thread Ista Zahn
I don't really understand this data table, but maybe this modification will give you the idea: dat <- read.table(text="father mother num_daughterdaughter 291 39060 NA 275 42190 NA 273 42361 49410 281 41631 49408 274 42261

[R] how to read a df like that and transform it?

2013-01-23 Thread Yao He
Dear all I have a data.frame like that : father mother num_daughterdaughter 291 39060 NULL 275 42190 NULL 273 42361 49410 281 41631 49408 274 42261 49406 295 38692 49403 49404

Re: [R] How to read a file with two data sets in text format

2013-01-21 Thread jim holtman
Here is one way to read the data. Modified your sample for the line counts of actual data: x <- readLines(textConnection("40 Terry Cove-Model 300 .300110459327698 300.041656494141 .289277672767639 300.083343505859 .276237487792969 300.125 .258902788162231 300.166656494141 .236579895019531 300.20

Re: [R] How to read a file with two data sets in text format

2013-01-21 Thread Jeff Newmiller
You have to sync up the data before you can do a scatter plot. If the data are changing slowly relative to the sample rates then you can use approx to interpolate one data set at the timestamps of the second to generate a column you can add to the second data frame. -

Re: [R] How to read a file with two data sets in text format

2013-01-21 Thread Janesh Devkota
I was able to read the data using the following code: jd1 <- read.table('Practicedata.dat',header=T,sep="\t",nrow=6240) jd2 <- read.table('Practicedata.dat',header=T,sep="\t",skip=6241) colnames(jd1) <- c("Date","Mod") colnames(jd2) <- c("Date", "Obs") p <- ggplot(jd1,aes(x=Date,y=Mod))+geom_line(

[R] How to read a file with two data sets in text format

2013-01-20 Thread Jd Devkota
Hello All, I have a data file in a text format and there are two data sets. The data set are continuous. For each data set there is a header which has the number of data rows and the name of data series. For example first data set has "6240 Terry Cove-Model". Then the data for that series follows

Re: [R] how to read different files into different objects in one time?

2012-12-27 Thread Jeff Newmiller
Man, if that medicine doesn't cure you of wanting to create dozens of different objects in memory, I don't know what will. Let's see: 1) Creates a potentially large number of global objects with names unrelated to their content 2) Creates and updates a global variable for future race condition d

Re: [R] how to read different files into different objects in one time?

2012-12-26 Thread Heramb Gadgil
You can try this one too. #Set the directory to a path where all the files to be read are stored TabletoRead=list.files(pattern=".txt") I_Step=unlist(lapply(TabletoRead,function(tab){ srno<<-ifelse(exists("srno"),(1+srno),1) Temp=read.table(tab,header=T,s

Re: [R] how to read different files into different objects in one time?

2012-12-19 Thread Jeff Newmiller
The short answer is: don't try. You really don't want dozens of different objects in memory that you didn't name yourself. What you want instead is a list of objects. You can start with a vector of filenames and use lapply to create another list containing the data frames. For convenience you c

Re: [R] how to read different files into different objects in one time?

2012-12-19 Thread Jorge I Velez
Dear Yao, You can use a list() as follows (untested): setwd("~/path/to/your/files") f <- list.files(pattern = ".txt") # list the files info <- lapply(f, read.table, header = TRUE) names(info) <- f info To see the information in the first data set just do info[[1]] See ?list.files and ?lapply

  1   2   3   4   >