similar to: Read many .csv files into an R session automatically, without specifying filenames

Displaying 20 results from an estimated 30000 matches similar to: "Read many .csv files into an R session automatically, without specifying filenames"

2008 Sep 05
2
xls to csv conversion via WinXP's context menu?
Frequently I need to convert a .xls to a .csv (for import into R) and I do this by opening the file in excel and saving it as a csv. I would rather do this using WinXP's context menu (right click the xls, choose "convert to csv") but I don't know of a utility that does this. Any ideas? Thanks, Mark
2010 Sep 26
2
get absolute file path
Hello, I get a value which stores a relative file name. (I get it from another function, which I don't want to change.) e.g. > fileName <- "../data/2010-08.csv"; Is it possible to get the absolute file path out of this value? (e.g. /home/sebastian/documents/data/2010-08.csv) Kind regards, Sebastian
2010 May 29
3
S4 dispatch for .DollarNames (utils)
Hello, I'm trying to make .DollarNames generic and implement a method for it in a package. .DollarNames is the function that is now called to get completion possibilities. My R code looks like this: setGeneric( ".DollarNames" ) setClass("track", representation(x="numeric", y="numeric")) ## A class extending the previous, adding one more
2011 Nov 21
1
extending the colClasses argument in read.table
Hello, We've released the int64 package to CRAN a few days ago. The package provides S4 classes "int64" and "uint64" that represent signed and unsigned 64 bit integer vectors. One further development of the package is to facilitate reading 64 bit integer data from csv, etc ... files. I have this function that wraps a call to read.csv to: - read the "int64"
2009 Mar 19
4
Import R-output into Java
Hello, I want to import R-output via Rserve to Java, especially for the function ctree from the package party. Rserve is working properly. Yet, I only get the predictions with the Java code try{ RConnection c = new RConnection(); ... c.voidEval("modell <- ctree(...)"); REXP y = c.eval("nodes(modell,1)[[1]]$prediction"); ...
2009 Jul 30
2
CRAN + geography = Cranography
In response to an earlier discussion about finding the fastest/best/nearest CRAN site, I geocoded (using my geonames package) the locations of the CRAN sites returned by getCRANmirrors. I've mapped them here: http://www.maths.lancs.ac.uk/~rowlings/R/Cranography/ The geocoding may have got it wrong, so if CRAN site maintainers want to send me a real lat-long (in WGS 84 aka EPSG:4326) I'll
2009 Jul 03
6
Remove all spaces from a string so it can be used by assign()
Hi I have a string "56 Fe [1]" that I would like to use as a variable name by using "assign" however I think the spaces and brackets might be causing R some trouble. How can I change the string so that it just becomes 56Fe1 and can be used as a variable name. Thank You Kurt _________________________________________________________________ [[elided Hotmail spam]]
2009 Dec 02
2
Arithmetic on multiple files
Dear R-users, I'd like to perform arithmetic functions on 1000 files containing a 2000x2000 matrix. Can anyone advise? For example, File1 File2 Output 1 1 1 4 4 4 5 5 5 2 2 2 + 5 5 5 = 7 7 7 3 3 3 6 6 6 9 9 9 Muhammad -- Muhammad Rahiz | Doctoral Student in Regional Climate Modeling Climate Research
2009 Oct 09
1
celebrating revision 50000
Hello, Today, Brian Ripley commited the revision 50000 of R's svn repository. I took this as an opportunity to do some data analysis of the log and posted some code and graphics on my blog: http://romainfrancois.blog.free.fr/index.php?post/2009/10/09/celebrating-R-commit-50000 The plots of the number of commits per day (and per month) indicates a peak in 2002. Here are the top 20
2009 Sep 17
3
How to generate a matrix where each row (or column) is the same vector?
Hi, I can use the following code to generate a matrix, each column of which is 'x'. But I have to specify '5' twice in the second command. I am wondering if there is a better way to do it. > x=1:10 > matrix(rep(x,5),nc=5) > t(matrix(rep(x,5),nc=5)) Regards, Peng
2010 Jun 18
2
nchar( NA )
Hello, Is this expected ? > nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery collage `- http://bit.ly/bZ7ltC : inline 0.3.5
2008 Apr 08
1
Combining many csv files into one and adding a column with an id of each csv file read
Dear R experts, I have been looking into the help-pages and old questions from the R-Help site, but the options offered there don't seem to work in my case. First of all, I am working on Windows XP, using R version 2.6.2. I am attaching two csv files as an example of how the data I am traying to put together is delivered to us. On the first row of every csv file is the name of the
2010 Apr 30
2
RInside & child threads
Hi Folks, I am creating a multi-threaded C++ application that initializes RInside in one of the child thread. I would also like to access support interfaces like Rcpp::Environment in the remaining child threads, so that I could access any "R" function associated with the environment initialized. When I run my program, I always get "C Stack limit too huge" errors. I looked
2010 Feb 11
2
LinkingTo and C++
Hello, I've been trying to make LinkingTo work when the package linked to has c++ code. I've put dumb packages to illustrate this emails here ; http://addictedtor.free.fr/misc/linkingto Package A defines this C++ class: class A { public: A() ; ~A() ; SEXP hello() ; } ; Package B has this function : SEXP say_hello(){ A a ; return a.hello() ; } headers of package A are copied
2009 Dec 01
4
Package is loaded but functions are not exported
Hello, I wrote a package, which in the NAMESPACE file exports functions like this: exportPattern("^\\rh") On R-2.8 (Linux, 64), upon loading the package I have the rh functions present. On R-2.10, Mac OS X, (32 bit), it builds, loads, but the functions are not loaded, i.e the only function is rhyper (which is not from my package). Is there something wrong with my package setup?
2011 May 31
1
assignInNamespace and new bindings
Hello, assignInNamespace refuses to assign an object to a name that is not already used in the namespace. Something like this would make it possible: --- src/library/utils/R/objects.R (revision 56024) +++ src/library/utils/R/objects.R (working copy) @@ -252,8 +252,9 @@ stop("environment specified is not a package") ns <- asNamespace(substring(nm, 9L))
2009 Jul 02
1
package post install instructions
Hello, I've looked in tools:::.install_packages for some sort of hook that would let packages developers point to further instructions after a package is installed. For example, some packages need to setup environment variables, ... Is there something I have missed ? Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |-
2009 Dec 15
1
S4 dispatch and S3 "connection" objects
Hello, I'm trying to get S4 dispatch on S3 "connection" objects. So I do : setOldClass( "connection" ) and then : setGeneric( "bling", function(object) standardGeneric( "bling" ) ) setMethod( "bling", "connection", function(object) cat( "gotcha ", as.integer(object), "\n" ) ) but I get : f <- file(
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
Hello, As this little program illustrates, duplicating a STRSXP does not seem deep enough. require( inline ) fx <- cfunction( signature( x = "character"), ' SEXP y = PROTECT( duplicate( x ) ); int n = LENGTH(x); int nc = 0 ; char* p = 0 ; for( int i=0; i<n; i++){ p = (char*)( CHAR( STRING_ELT( y , i ) ) ); nc = strlen( p ) ; for( int j=0; j<nc; j++){ p[j] =
2010 Feb 08
5
Fast way to determine number of lines in a file
Hi all, Is there a fast way to determine the number of lines in a file? I'm looking for something like count.lines analogous to count.fields. Hadley -- http://had.co.nz/