similar to: How to read only specified columns from a data file

Displaying 20 results from an estimated 10000 matches similar to: "How to read only specified columns from a data file"

2002 Jan 03
2
Different behaviour of data()
Dear List, I frequently use the data() function to load csv files (with separator ";") into R session, typically data(myfile) loads myfile.csv from my working/data directory into R. Now, in 1.4.0 version, everything works as expected, but with one difference: The values readed in older versions in "num" mode are now readed as "int" mode, converting the values
2010 Sep 08
2
big data
Hello, I searched the internet but i didn't find the answer for the next problem: I want to do a glm on a csv file consisting of 25 columns and 4 mln rows. Not all the columns are relevant. My problem is to read the data into R. Manipulate the data and then do a glm. I've tried with: dd<-scan("myfile.csv",colClasses=classes) dat<-as.data.frame(dd) My question is: what
2010 May 19
1
export dataframe's column classes to a list
Hi Folks, I want to export a dataframe's column classes to a list so that I can reinstantiate the dataframe from a CSV file in the future. (I know about save(), which I'm using in addition to this). what I want to do is the following: write.csv(myframe); col_classes = get_col_classes(myframe); write.csv(col_classes, "column_classes") ... time passes, R gets
2010 Oct 04
3
read columns of quoted numbers as factors
Suppose I have a data file (possibly with a huge number of columns), where the columns with factors are coded as "1", "2", "3", etc ... The default behavior of read.table is to convert these columns to integer vectors. Is there a way to get read.table to recognize that columns of quoted numbers represent factors (while unquoted numbers are interpreted as
2011 Jul 12
1
suggestions regarding reading in a messy file
I have a file in stata format, which I have read in, and I am trying to create a text file. I have exported the data using various delimiters, but I'm unable to read it back in. I originally read in the file with: library(foreign) myData <- read.dta("mydata.dta") I then exported it with write.table using comma, tab, and exclamation marks as a delimiter. When I was unable to
2011 Jun 09
2
scatterplot3d - help assign colors based on multiple conditions
Hi I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want to extend the condition to assign a color based on the names of both x-axis and y-axis values, what should I be doing? Any help or ideas would be
2007 May 03
1
A question about POSIXct
Dear List: I have a simple two-column data set in .csv format, with the first column being the date and second column being some value. I use read.csv() to import the data as follows: x <- read.csv("myfile.csv",header=T, dec=".", colClasses=c(Date="POSIXct")) The structure of x is: > str(x) `data.frame': 2959 obs. of 2 variables: $
2013 Jun 10
1
Selecting divergent colors
Hi, I was trying to make a density plot with 13 samples. To distinguish each sample, it would be good if each color is as different as possible from the other colors. I could use the built in function, but that does not do more than 8 colors and then goes back to recycling the cols. If I use a palette, then it is really difficult to distinguish between the colors. So, is there a way that I can
2014 Jan 31
2
manipulación de caracteres
lo que necesito es "98989","121212" y no : paste(unlist(strsplit(char,",")),collapse=",") [1] "98989,121212" Luis -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Luis Ridao Cruz Faroe Marine Research Institute Nóatún 1, P.O. Box 3051 FO-110 Tórshavn Faroe Islands Tel : (+298) 353900 Fax: : (+298) 353901 e-mail: luisr@hav.fo
2013 Jan 29
1
points rejected as lying outside the specified window
Hello, I am using the following code to create ppp files from csv data and map shape files, but I am getting some errors which I have been unable to fix by searching them online: library(spatstat) library(maps) library(maptools) NYC2<-readShapePoly("nybb.shp") # this is a map of the NYC boroughs without waterways and no census tract divisions (but it does include lines separating
2014 Jan 31
2
manipulación de caracteres
esto me convierte la cadena de caracteres en dos y eso no es lo que quiero además el resultado final de la cadena debe ser: "98989","121212" Luis -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Luis Ridao Cruz Faroe Marine Research Institute Nóatún 1, P.O. Box 3051 FO-110 Tórshavn Faroe Islands Tel : (+298) 353900 Fax: : (+298) 353901 e-mail: luisr@hav.fo
2014 Feb 11
2
eliminar texto de un fichero
Carlos, eso sería una buena solución. el problema es que utilizo el sink() para redireccionar no solo uno sino varios datos en forma matricial y de lista Luis -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Luis Ridao Cruz Faroe Marine Research Institute Nóatún 1, P.O. Box 3051 FO-110 Tórshavn Faroe Islands Tel : (+298) 353900 Fax: : (+298) 353901 e-mail: luisr@hav.fo
2012 May 07
1
Plotting a raster image
Hello, I have a data frame which looks like > head(d) a1 a2 n j col 1 1 1 88341002 11 #E7E7E7 2 1 2 25094882 11 #E7E7E7 3 1 3 16916246 11 #E7E7E7 4 1 4 14289229 11 #E7E7E7 5 1 5 11945929 11 #E7E7E7 6 1 6 8401235 11 #E7E7E7 The values in 'j' run from 1 to 11. I would like to plot the point (a1,a2) with color given by j I tried mi <-
2007 Nov 08
3
skip non-sequential lines using scan?
Hi all, Is there a way to skip non-sequential lines using the "skip" argument in the scan function? E.g., I have a matrix with 100 rows and 1e7 columns. I open a connection and want to read only lines 5, 7, 9, etc [i.e., seq(5,99,2)] It might seem that the syntax to do this would be something like this (if only the "skip" allowed vectors in the same way colClasses does in
2014 Apr 01
2
problema con RStudio
Hola, ¿qué tal? ¿Puedes comparar la salida del comando Sys.getenv("LD_LIBRARY_PATH") en una sesión en la que funciona RODBC y otra en la que obtienes el error anterior? Un saludo, Carlos J. Gil Bellosta http://www.datanalytics.com P.D.: A propósito, también he estado tratando de utilizar RODBC en Linux y me he acabado rindiendo. Sobre todo porque RJDBC funciona bastante bien.
2014 Apr 01
2
problema con RStudio
Pues ahí lo tienes. De alguna manera R (a través de RStudio) no está incorporando el directorio /u01/app/luisr/product/11.1.0/client_1/lib donde se ve que tienes las librerías de ODBC al "LD path". Échale un vistazo a https://support.rstudio.com/hc/communities/public/questions/200641818-How-to-configure-libPaths-?locale=en-us Aparentemente RStudio tiene su propio sistema para
2014 Feb 11
2
eliminar texto de un fichero
No estoy seguro si esto sirve, ya que no enviaste un ejemplo reproducible. source("mifuncion.R", echo=TRUE, max.deparse.length=10000) Daniel Merino El 11 de febrero de 2014, 12:48, Carlos Ortega <cof@qualityexcellence.es>escribió: > Hola, > > Sí, pero recuerda que "write()" permite añadir otros nuevos objetos a un > fichero ya existente... > Vaya,
2014 Feb 11
2
eliminar texto de un fichero
Daniel, eso funciona en la terminal pero mi argumento to regex o grep es un fichero ahi es donde me encuentro atascado Luis -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- Luis Ridao Cruz Faroe Marine Research Institute Nóatún 1, P.O. Box 3051 FO-110 Tórshavn Faroe Islands Tel : (+298) 353900 Fax: : (+298) 353901 e-mail: luisr@hav.fo luridao@gmail.com
2014 Apr 01
3
problema con RStudio
No, no estoy usando Rstudio Server El 1 de abril de 2014, 9:07, Carlos J. Gil Bellosta <cgb@datanalytics.com>escribió: > Una pregunta... no estarás utilizando RStudio server, ¿verdad? > > En tal caso, lo que tienes que hacer es configurar > /etc/rstudio/rstudio.conf tal como indica en > > http://www.rstudio.com/ide/docs/server/configuration > > En particular,
2012 Apr 23
1
Can I specify POSIX[cl]t column classes inside read.csv?
I'm loading a nicely formatted csv file. ? ? #!/usr/bin/env Rscript ? ? kpi <- read.csv( ? ? ? # This is a dump of the username, date_joined and last_login columns ? ? ? # from the auth_user Django table. ? ? ? 'data/2012-04-23.csv', ? ? ? colClasses = c('character') ? ? ) ? ? print(kpi[sample(nrow(kpi), 3),2:3]) Here's what the three rows I printed look like. ? ? ? ?