Re: [R] Importing data with value labels into R

2022-11-14 Thread IAGO GINÉ VÁZQUEZ
Hello Maryam, The haven function for reading Stata files is read_dta (not read.dta!!!). May this be your issue? Iago De: R-help de part de Maryam Iraniparast Enviat el: dilluns, 14 de novembre de 2022 19:07 Per a: r-help@r-project.org Tema: [R] Importing dat

Re: [R] Importing data using Foreign

2020-08-27 Thread Elham Daadmehr
Thanks a lot. I’ve got it just now. On Wed, Aug 26, 2020 at 6:03 PM peter dalgaard wrote: > It is because you don't know whether you want it or not. > > It is a bit more obvious with integer indexing, as in color[race]: if race > is NA you don't know what color to put in, but the result should b

Re: [R] Importing data using Foreign

2020-08-27 Thread Elham Daadmehr
Thanks for your reply. You're right, here is what I did: > library(foreign) > sz201401=read.spss("/Users/e.daadmehr/Desktop/Term/LastLast/untitled folder/2014/1.sav", to.data.frame=TRUE) Warning message: In read.spss("/Users/e.daadmehr/Desktop/Term/LastLast/untitled folder/2014/1.sav", : /

Re: [R] Importing data using Foreign

2020-08-27 Thread Elham Daadmehr
Thanks guys. but I'm a bit confused. the input is the first column (z[,1] and z1[,1]). How is it possible that a subset of a non-NA vector, contains NA? On Wed, Aug 26, 2020 at 4:58 PM Eric Berger wrote: > Good point! :-) > > > On Wed, Aug 26, 2020 at 5:55 PM peter dalgaard wrote: > >> Offhand,

Re: [R] Importing data using Foreign

2020-08-26 Thread peter dalgaard
It is because you don't know whether you want it or not. It is a bit more obvious with integer indexing, as in color[race]: if race is NA you don't know what color to put in, but the result should be the same length as race. With logical indices, the behaviour is a bit annoying, but ultimatel

Re: [R] Importing data using Foreign

2020-08-26 Thread Eric Berger
c(1:3)[c(1,NA,3)] [1] 1 NA 3 On Wed, Aug 26, 2020 at 6:06 PM Elham Daadmehr wrote: > Thanks guys. but I'm a bit confused. the input is the first column (z[,1] > and z1[,1]). > How is it possible that a subset of a non-NA vector, contains NA? > > On Wed, Aug 26, 2020 at 4:58 PM Eric Berger wrot

Re: [R] Importing data using Foreign

2020-08-26 Thread Eric Berger
Good point! :-) On Wed, Aug 26, 2020 at 5:55 PM peter dalgaard wrote: > Offhand, I suspect that the NAs are in the 8th column. > > > On 26 Aug 2020, at 10:57 , Elham Daadmehr wrote: > > > > Hi all, > > > > I have a simple problem. I get stuck in using the imported spss data > (.sav) > > using

Re: [R] Importing data using Foreign

2020-08-26 Thread peter dalgaard
Offhand, I suspect that the NAs are in the 8th column. > On 26 Aug 2020, at 10:57 , Elham Daadmehr wrote: > > Hi all, > > I have a simple problem. I get stuck in using the imported spss data (.sav) > using "read.spss". > I imported data (z) without any problem. After importing, the first column

Re: [R] Importing data using Foreign

2020-08-26 Thread Eric Berger
Hi Elham, You are not giving us much to go on here. Show us the commands that (a) confirm there are no NA's in the first column of z and (b) output a row of z that has an NA in the first column. Here's how one might do this: (a) sum(is.na(z[,1])) (b) z[ match(TRUE, z[,8] %in% c("11","12","14")), ]

Re: [R] importing data error question

2019-01-18 Thread Fox, John
Dear Jihee, > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of ??? > Sent: Wednesday, January 16, 2019 7:02 PM > To: Fox, John > Cc: r-help@r-project.org > Subject: Re: [R] importing data error question > > Thanks for your

Re: [R] importing data error question

2019-01-18 Thread 우지희
Thanks for your help! I was having trouble with finding how to use english... Even though I try to use english language, I couldn't change language of R commander. (it is still korean) Sorry but.. do you know how to change language of "R commander"? I have no idea why it doesn't change. B

Re: [R] importing data error question

2019-01-18 Thread Fox, John
Dear Jihee, > On Jan 17, 2019, at 7:00 PM, 우지희 wrote: > > Dear John, > > (1) I noticed that you loaded the FactoMineR and SensoMineR plug-ins. Try > again without loading these plug-ins. > not worked :( > > OK. I don't understand why that doesn't work. There is likely some peculiarity in

Re: [R] importing data error question

2019-01-17 Thread Fox, John
Dear Jihee, Your latest attempt has gotten farther than the previous one but has produced a different error. The command to read the data set was generated properly. You can see whether the data set was in fact read by typing prestige (the name you gave to the data set) at the > command prompt

Re: [R] importing data error question

2019-01-16 Thread Fox, John
Dear Jihee, This appears to be a different problem. You were apparently able to access the spreadsheet file, but the R Commander didn't find a suitable worksheet in it. Try downloading and reading the file at . If that wor

Re: [R] importing data error question

2019-01-16 Thread Fox, John
Dear Jihee, Probably the easiest way to change the language to English temporarily in R is to enter the command Sys.setenv(LANGUAGE="en") at the R command prompt prior to loading the Rcmdr package. I hope that this helps, John > On Jan 16, 2019, at 7:02 PM, 우지희 wrote: > > Thanks f

Re: [R] importing data error question

2019-01-16 Thread Fox, John
Dear jihee, I've looked into this problem further, using my Mac where it's easier to temporarily change languages and character sets than on Windows, and I discovered the following: I was able to duplicate your problem with importing Excel files when working in Korean. There's a similar proble

Re: [R] importing data error question

2019-01-14 Thread Fox, John
Dear jihee, > On Jan 14, 2019, at 9:00 PM, 우지희 wrote: > > You said previously that you were using a Mac, so I'm surprised that you now > say that you're using Windows. I don't have a Windows 7 system, but I can > confirm that importing from Excel files works perfectly fine under Windows > 10,

Re: [R] importing data error question

2019-01-14 Thread 우지희
You said previously that you were using a Mac, so I'm surprised that you now say that you're using Windows. I don't have a Windows 7 system, but I can confirm that importing from Excel files works perfectly fine under Windows 10, as I just verified, and I'd be surprised if the Windows version ma

Re: [R] importing data error question

2019-01-14 Thread Fox, John
Dear jihee, > On Jan 13, 2019, at 9:28 PM, 우지희 wrote: > > > > From: "우지희" > Sent: Monday, January 14, 2019 9:40:26 AM > To:"Fox, John" > Subject:Re: [R] importing data error question > > > Thanks for your replies. > > I'm using windows 7, I loaded FactoMineR, You said previously tha

Re: [R] importing data error question

2019-01-11 Thread Fox, John
Dear Petr and jihee, The Rcmdr can import Excel files, and as I just verified, it can do so on a Mac listing files of all types (*) in the open-file dialog box (which is the default). So, as Petr suggests, more information is required to help you, including the versions of macOS, R, and all p

Re: [R] importing data error question

2019-01-11 Thread PIKAL Petr
Hi I do not use Rcmdr but from documentation it seems to me that it does not have much to do with importing data from Excel. So without some additional info from your side (at least used commands) you hardly get any reasonable answer. Cheers Petr > -Original Message- > From: R-help O

Re: [R] Importing data from a text file with no separator

2016-06-09 Thread Duncan Murdoch
On 09/06/2016 8:56 AM, Federman, Douglas wrote: ?read.fwf There is a data import/export document on cran.r-project.org And included with R distributions. It's one of the manuals, and will be accessible via the help menu in front ends that have one. Duncan Murdoch -Original Message

Re: [R] Importing data from a text file with no separator

2016-06-09 Thread Federman, Douglas
?read.fwf There is a data import/export document on cran.r-project.org -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paolo Letizia Sent: Wednesday, June 08, 2016 8:40 PM To: r-help@r-project.org Subject: [R] Importing data from a text file with no s

Re: [R] Importing data from a text file with no separator

2016-06-08 Thread Adrian Dușa
See: ?read.fwf Example: > ff <- tempfile() > cat(file = ff, "10030614911608", "10030614911608", sep = "\n") > read.fwf(ff, widths = c(2,8,10), colClasses = "character") V1 V2 V3 1 10 03061490 000116 2 10 03061490 000116 > unlink(ff) Hth, Adrian On Thu,

Re: [R] Importing data by targeting in filenames inside a nested list

2015-12-09 Thread PIKAL Petr
Hi I did not see any answer so I give it a try. Your approach seems to be OK. However you probably need to polish your code to get the correct part of nested list. > lll<-list(a=rnorm(10), b= list(x=1:10, y<-letters)) > lll[[1]] [1] -0.1876418 1.5933030 -0.1799642 0.1713959 1.1079227 -0.58

Re: [R] Importing data by targeting in filenames inside a nested list

2015-12-08 Thread Ivan Calandra
Hi Mario, It is at the limit of my skills so I'm not sure this will be a real solution. But it might help you anyway (and there will be more competent people anyway). What does not make sense to me is why you set the names of your files and then use them to list them with list.files() What

Re: [R] Importing data into R

2014-01-11 Thread arun
Hi, May be this helps: url <- "http://genome.ucsc.edu/cgi-bin/hgc?hgsid=358528009&g=htcDnaNearGene&i=uc003qec.4&c=chr6&l=133562494&r=133853258&o=knownGene&hgSeq.promoter=on&boolshad.hgSeq.promoter=0&hgSeq.promoterSize=10759&hgSeq.utrExon5=on&boolshad.hgSeq.utrExon5=0&hgSeq.cdsExon=on&boolshad.hgSe

Re: [R] Importing data by odbcConnectExcel in 64 bit

2013-07-16 Thread Peter Alspach
Tena koe Perhaps the help file will give you some ideas: "odbcConnectAccess, odbcConnectDbase and odbcConnectExcel are convenience wrappers to generate connection strings for those file types. The files given can be relative to the R working directory or absolute paths (and it seems also relat

Re: [R] Importing data by odbcConnectExcel in 64 bit

2013-07-16 Thread Adams, Jean
Can't help you with the odbcConnectExcel, but I can suggest an alternative ... loadWorkbook() and readWorksheet() in the XLConnect package work on Windows 7 64-bit. library(XLConnect) wb <- loadWorkbook("C:/Temp/Mydata.xlsx") dat <- readWorksheet(wb, sheet="Sheet1") Jean On Tue, Jul 16, 2013 at

Re: [R] importing data

2013-01-28 Thread Ivan Calandra
This code is indeed much shorter. About the speed, I guess it should be faster, but you should test it with system.time() I'm glad that it helped. Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.cala

Re: [R] importing data

2013-01-28 Thread Ray Cheung
Dear Ivan, It works perfectly fine now. I love this code more since I need not delete the NULL list myself (and it should be faster, right?). Thank you very much for your help! cheers, Ray On Mon, Jan 28, 2013 at 5:32 PM, Ivan Calandra wrote: > What about this then: > list_of_datasets <- lappl

Re: [R] importing data

2013-01-28 Thread Ivan Calandra
What about this then: list_of_datasets <- lapply(file_names, read.table, other_args_to_read.table) Something that might then be useful is: names(list_of_datasets) <- file_names Does it do it now? Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel

Re: [R] importing data

2013-01-27 Thread Ray Cheung
Thanks a million for all help provided!! I can do what I intend to using the "for loop". However, I'm still eager to try the list.files approach. Here is the error message that I got using Ivan's code: > list_of_dataset <- do.call(read.table, file_names) Error in do.call(read.table, file_names) :

Re: [R] importing data

2013-01-27 Thread Ivan Calandra
Hi Ray! I'm insisting with list.files...! What about like this (untested)? file_names <- list.files(path="C:/.../data", pattern=".dat$", full.names=TRUE) list_of_dataset <- do.call(read.table, file_names) Let me know if this helps! Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282

Re: [R] importing data

2013-01-26 Thread David Hugh-Jones
Hi Ray, Comments below: On 26 January 2013 09:03, Ray Cheung wrote: [snip] > ###FUNCTION TO READ FILES > little_helpful <- function(n) { > file_name <- paste0("C:/.../data", n, ".dat") > read.table(file_name) > } > > ###RETURN AN OBJECT WHICH CHECKS FOR THE EXISTENCE OF FILES > check <- function

Re: [R] importing data

2013-01-26 Thread Ray Cheung
Thanks for your commands, Ivan and Michael! However, I am still not producing the right codes. Would you please help me on this? I've written the following codes. Please comment. Thank you very much. Task: Reading data1.dat to data1000.dat (with missing files) into R. Missing files can be omitted

Re: [R] importing data

2013-01-25 Thread Ivan Calandra
Hi, Not sure this is what you need, but what about list.files()? It can get you all the files from a given folder, and you could then work this list with regular expressions for example. HTH, Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 210

Re: [R] importing data

2013-01-25 Thread R. Michael Weylandt
On Fri, Jan 25, 2013 at 6:11 AM, Ray Cheung wrote: > Dear Michael, > > Thanks for your codes. However, lapply does not work in my case since I've > some files missing in the data (say, the file data101.dat). Do you have any > suggestions on this?? Thank you very much. > You could simply add a tes

Re: [R] importing data

2013-01-24 Thread Ray Cheung
Dear Michael, Thanks for your codes. However, lapply does not work in my case since I've some files missing in the data (say, the file data101.dat). Do you have any suggestions on this?? Thank you very much. Best Wishes, Ray On Wed, Jan 23, 2013 at 8:15 PM, R. Michael Weylandt < michael.weyla...

Re: [R] importing data

2013-01-23 Thread R. Michael Weylandt
On Wed, Jan 23, 2013 at 9:16 AM, Ray Cheung wrote: > Dear All, > > Sorry for asking a newbie question. I want to ask how to import 1000 > datasets whose file names are labelled from data1.dat to data1000.dat into > R so that they are named M[1, , ] to M[1000, , ] accordingly. Thank you > very much

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread arun
Hi, Not sure why you wanted to separate A and B for a two sample t-test. dat1<-read.table(text=" weights  company 1  A 2  A 2  B 3  B ",sep="",header=TRUE,stringsAsFactors=FALSE)  t.test(weights~company,data=dat1) #    Welch Two Sam

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread Peter Ehlers
On 2012-11-14 20:52, nilsonern wrote: I am trying to do a two sample t-test with data that i received in a text document. one list has the slab weights and the second has the company it is associated with. here is an example. weights company 1 A 2 A 2

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread arun
HI, If you need to separate into two datasets,  dat1[dat1$company=="A",] #  weights company #1   1   A #2   2   A #or  dat1[dat1$company=="B",] #or split into a list  split(dat1,dat1$company) A.K. - Original Message - From: nilsonern To: r-help@r-project.org Cc:

Re: [R] Importing Data for a two sample t-test

2012-11-15 Thread Jeff Newmiller
?subset --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Enginee

Re: [R] Importing data from stata.

2012-04-16 Thread Uwe Ligges
On 16.04.2012 12:56, Søren Andersen wrote: Hi everyone! I am very new at R. I am trying to import a data file from stata to R on a Macintosh system ? When I use the foreign function read.dta it says: You forgot to load foreign: library("foreign") Uwe Ligges Error: could not f

Re: [R] Importing data from MS EXCEL (.xls) to R XXXX

2011-08-25 Thread Kathleen Rollet
il.com > CC: r-help@r-project.org > Subject: Re: [R] Importing data from MS EXCEL (.xls) to R > > Hi Dan, > > You might try > > require(gdata) > ?read.xls > > HTH, > Jorge > > > On Wed, Aug 24, 2011 at 6:20 PM, Dan Abner <> wrote: >

Re: [R] Importing data from MS EXCEL (.xls) to R XXXX

2011-08-24 Thread B77S
I agree with Ken.. if you can, save it as a CSV file. But if you have a bunch of these, then it isn't very efficient. I use read.xlsx() from the package "xlsx". I notice that you are using the full path.. have you tried changing directories?... I find it is best to compartmentalize my work and

Re: [R] Importing data from MS EXCEL (.xls) to R XXXX

2011-08-24 Thread Jorge I Velez
Hi Dan, You might try require(gdata) ?read.xls HTH, Jorge On Wed, Aug 24, 2011 at 6:20 PM, Dan Abner <> wrote: > Hello everyone, > > What is the simplest, most RELIABLE way to import data from MS EXCEL (.xls) > format to R? In the past I have used the read.xls() function from the > xlsReadWri

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread William Dunlap
> -Original Message- > From: gerald.j...@dgag.ca [mailto:gerald.j...@dgag.ca] > Sent: Friday, February 05, 2010 10:58 AM > To: William Dunlap > Cc: Uwe Ligges; r-help@r-project.org > Subject: RE: [R] Importing data coming from Splus into R. > > Hello Bill, >

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread gerald . jean
S+'s > write.table and R's read.table I could try to fix > things up so they were more compatible. > > Code that reads the S+ native binary format must > be 32/64 bit aware, since S+ integers are 32 bits > on 32-bit versions of S+ and 64 bits on 64-bit > versions. > &

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread William Dunlap
; To: Gerald Jean > Cc: r-help@r-project.org > Subject: Re: [R] Importing data coming from Splus into R. > > 1. I am stuck with a copy of S-PLUS 4.x. At that time I used > dump() in > S-PLUS and source() to get things into R afterwards ... > > 2. Why do you think that 32

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread gerald . jean
Uwe Ligges a écrit sur 2010/02/05 11:04:44 : > 1. I am stuck with a copy of S-PLUS 4.x. At that time I used dump() in > S-PLUS and source() to get things into R afterwards ... > > 2. Why do you think that 32-bit vs. 64-bit issues matter? The file > format does not change (well, this is guessed s

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread Uwe Ligges
1. I am stuck with a copy of S-PLUS 4.x. At that time I used dump() in S-PLUS and source() to get things into R afterwards ... 2. Why do you think that 32-bit vs. 64-bit issues matter? The file format does not change (well, this is guessed since I do not have any 64-bit S-PLUS version availabl

Re: [R] Importing data coming from Splus into R.

2010-02-05 Thread RICHARD M. HEIBERGER
Have you tried dput/dget or dump/source? On the S-Plus side, you need to tell it to use the older format. Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/p

Re: [R] importing data from BUGS format to R?

2010-01-05 Thread Pseudomonas
Martyn Plummer-2 wrote: > > I wrote a function called "bugs2jags", which you will find in the coda > package, for converting WinBUGS data files into the data format used by > JAGS which is, by no coincidence, the format used by the R function > dump(). > First of all excuse me for reviving thi

Re: [R] Importing data from text file with mixed format

2009-10-26 Thread delnatan
All these have been really helpful. Once again I see that anything's possible in R! Thank you for the suggestion Bill, I think arranging the data in one data frame is a good idea. -Daniel William Dunlap wrote: > > >> -Original Message- >> From: r-help-boun...@r-project.org >> [mail

Re: [R] Importing data from text file with mixed format

2009-10-25 Thread Gabor Grothendieck
This solution uses strapply in gsubfn. It assumes the timepoints are 1, 2, 3, ... (although later we remove this restriction just in case). The first line reads in myfile. The second line reads the numeric rows into matrix s. The third line reads in the column names. The fourth line converts to

Re: [R] Importing data from text file with mixed format

2009-10-25 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of delnatan > Sent: Saturday, October 24, 2009 8:32 PM > To: r-help@r-project.org > Subject: [R] Importing data from text file with mixed format > > > Hi, > I'm having difficulty

Re: [R] Importing data from text file with mixed format

2009-10-25 Thread jim holtman
try this: > # read in the file > x <- readLines(textConnection("#begin text file + Timepoint 1 + ObjectNumber Volume SurfaceArea + 1 5.3 9.7 + 2 4.9 8.3 + 3 5.0 9.1 + 4 3.5

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread Andy Choens
On Thu, 2009-05-14 at 10:30 -0700, Sunita22 wrote: > Hello > > I have to import 2 txt files into R. 1 file contains the data and the other > contains the header, column headings, datatypes and labels for the data. > This is your first complicating factor. > I have 2 problems: > > 1) my data fi

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread Sunita Patil
Hello Yes I have used read.table("file name", sep="\t") for reading the text file Thank you On Thu, May 14, 2009 at 11:07 PM, jim holtman wrote: > What have you tried? Check the Intro manual for hints. > > ?read.table probably using sep='\t' > > On Thu, May 14, 2009 at 1:30 PM, Sunita22 wr

Re: [R] Importing data into R and combining 2 files

2009-05-14 Thread jim holtman
What have you tried? Check the Intro manual for hints. ?read.table probably using sep='\t' On Thu, May 14, 2009 at 1:30 PM, Sunita22 wrote: > > Hello > > I have to import 2 txt files into R. 1 file contains the data and the other > contains the header, column headings, datatypes and labels f

Re: [R] importing data to SQLite database with sqldf

2009-02-21 Thread Gabor Grothendieck
ead > union > select * from iristail') > sqldf() > >> sqldf("select * from sqlite_master",dbname="mydb")$name > [1] irishead iristail fulltable > Levels: fulltable irishead iristail > > ? ...I'll try to go figure a few more things out in

Re: [R] importing data to SQLite database with sqldf

2009-02-20 Thread Stephen Tucker
df() > sqldf("select * from sqlite_master",dbname="mydb")$name [1] irishead iristail fulltable Levels: fulltable irishead iristail ? ...I'll try to go figure a few more things out in the in the meantime (like using sep="\t" ?) and using connections with s

Re: [R] importing data to SQLite database with sqldf

2009-02-20 Thread Gabor Grothendieck
Have just added an example 12 on the home page: http://sqldf.googlecode.com that shows an example. Note use of notation main.mytable to refer to an existing table in the main database (as opposed to a data frame in R). On Thu, Feb 19, 2009 at 11:55 PM, Stephen Tucker wrote: > Hi all, > > I am

Re: [R] importing data from a disc or HDD [SEC=UNCLASSIFIED]

2009-02-02 Thread Paul Hiemstra
Kisch, Joe wrote: I hope this is not a stupid question, but I am having difficulty importing data from sources like CDs, HDD, or flashcards. Can anyone help ? Joe [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Importing data from clipboard on Mac OSX

2009-01-29 Thread Charles C. Berry
On Thu, 29 Jan 2009, Christian Anderson wrote: Hello R-Help, I noticed that there is a thread about importing data from the clipboard that is very poorly answered in the forum. One user suggests giving up, the other gives a solution that echoes the clipboard, but that's exactly the same as just

Re: [R] Importing data from SPSS with Arabic encoding

2009-01-07 Thread Prof Brian Ripley
On Wed, 7 Jan 2009, Florent Bresson wrote: Dear R-users, I'm facing a problem with the import of data in R. I have a sav file that, I presume, uses some Arabic encoding (but I don't know which one) and I would like to read it with R. When I use the function read.spss (I also tried spss.get(H

Re: [R] Importing data to a multidimensional array

2008-11-05 Thread Uwe Ligges
Jon Wong wrote: Hi, I was wondering if I could get some help on importing data into a three-dimensional array? I am importing data from several text files: dsdir<-"c:/documents and settings/desktop/07082008/" # path to files dsfb1<-"07082008-DI4129b.dat" # file base name firsthour<-13 # firs

Re: [R] Importing data with different delimters

2008-06-16 Thread Peter Dalgaard
Greg Snow wrote: > It looks like your original data may be tab seperated, if that is the case > then just use read.delim or use sep='\t' in read.table or scan. > I think that was only half the problem. If you do that, you end up with one column containing both City and State, comma-separated. P

Re: [R] Importing data with different delimters

2008-06-16 Thread milton ruser
Hi David, If the delimier is "tab" try this. my.df<-read.table("my_file.txt", head=T, sep="\t") Cheers, Miltinho Brazil > > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of David Arnold > > Sent: Friday, June 13, 2008 5:15 PM > > To: r-hel

Re: [R] Importing data with different delimters

2008-06-16 Thread Greg Snow
It looks like your original data may be tab seperated, if that is the case then just use read.delim or use sep='\t' in read.table or scan. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMA

Re: [R] Importing data with different delimters

2008-06-13 Thread jim holtman
Assuming that the only problem is the blank in the city names, here is one way of doing it: > inFile <- textConnection("City State JanTemp Lat Long + Mobile, AL 44 31.288.5 + Montgomery, AL 38 32.986.8 + Phoenix, AZ 35 33.6112.5 + Little Rock, AR 31

Re: [R] Importing data in text file into R

2008-05-23 Thread Patrick Connolly
On Fri, 23-May-2008 at 08:40PM -0700, amarjit singh sethi wrote: |> Dear all, |> I am quite new to R; facing certain problems: |> Say, I have a text file( named as "try"): |> > idt=read.table(df,header=T, sep="\t") |> > idt |> Year C1 C2 C3 C4 C5 C6 |> 1 Y1 3.5 13.8 9.5 6.8 0.4

Re: [R] Importing data in text file into R

2008-05-23 Thread John Fox
Dear AJSS, The problem is that the way you've read the data, the first column of the data frame is a factor, not a numerical variable, and thus is not suitable for computing correlations. You could use the command cor(idt[,-1]) to compute correlations on all but the first column, but your

Re: [R] Importing data

2008-05-07 Thread Wensui Liu
import stata data should be straight. take a look at foreign package On Wed, May 7, 2008 at 9:30 AM, Yemi Oyeyemi <[EMAIL PROTECTED]> wrote: > Hi everyone, please I'm having problem importing data from Stata and excel. > Help me out. > Thanks > > > - > [[elide

Re: [R] Importing data

2008-05-07 Thread Neil Shephard
Yemi Oyeyemi wrote: > > Hi everyone, please I'm having problem importing data from Stata and > excel. Help me out. > Thanks > > You don't provide... a) the code that you've tried b) the error message that relates to the problem you are having ...without these people have little informat

Re: [R] Importing data

2008-05-07 Thread Juan Manuel Barreneche
i usually import data from exel, using read.table or read.csv (which implies that i have to save exel files as .txt or .csv) JM El Miércoles, 7 de Mayo de 2008 11:25, John Kane escribió: > First step would be to read the manual on the R site > "R Data Import/Export" describes the import and expo

Re: [R] Importing data

2008-05-07 Thread John Kane
First step would be to read the manual on the R site "R Data Import/Export" describes the import and export facilities available either in R itself or via packages which are available from CRAN Then if that does not solve the problem you need to explain in detail what the problems are, preferably

Re: [R] Importing data

2008-01-08 Thread Michael Dewey
At 11:46 06/01/2008, Simo Vundla wrote: >Hi, >I'm trying to import categorical data from SPSS to R using the script: >xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately >am getting an error message 'error reading portable-file dictionary'. > >I have successfully imported data in th

Re: [R] Importing data

2008-01-06 Thread Prof Brian Ripley
On Sun, 6 Jan 2008, Rense Nieuwenhuis wrote: > Hi, > > you might try to use the foreign-package, which contains the function > read.spss. This works fine most of the time, > > For a description of its usage, see the help-files or my own website: > http://www.rensenieuwenhuis.nl/r-project/manual/ba

Re: [R] Importing data

2008-01-06 Thread Rense Nieuwenhuis
Hi, you might try to use the foreign-package, which contains the function read.spss. This works fine most of the time, For a description of its usage, see the help-files or my own website: http://www.rensenieuwenhuis.nl/r-project/manual/basics/getting-data- into-r-2/ Remember, you'll need t

Re: [R] Importing data

2008-01-06 Thread Frank E Harrell Jr
Simo Vundla wrote: > Hi, > I'm trying to import categorical data from SPSS to R using the script: > xxx <-spss.get("xxx.por", use.value.labels=TRUE) but unfortunately am getting > an error message 'error reading portable-file dictionary'. > > I have successfully imported data in the past. > > W