Displaying 20 results from an estimated 4000 matches similar to: "read.table : how to condition on error while opening file?"
2008 Jul 08
2
attributing values to dataframe positions following eval
Hi everybody,
I've been looking around, but can't seem to find the answer.
I get a list of names (which vary, so I never know them in advance), and
transform them into variables, each of which is a dataframe, using
assign:
polyList <- c("rs123", "rs124", "rs555", "rs000")
numPoly <- length(polyList)
for (k in 1:numPoly) {
2008 Jun 29
2
How to get an argument dynamically from a list?
Hi,
I'd like to get an argument (I think it's the right term) dynamically from a list, but cannot manage to do it.
Here is the code I use:
#output given by database
BOB <- c('A/A', 'C/C', '15/27')
MARY <- c('A/A', NA, '13/12')
JOHN <- c('A/A', 'C/A', '154/35')
CLIFF <- c('A/C', 'C/C',
2012 Jan 17
2
How to loop on file names
Dear all,
I need to do the same procedure on several files. But I don't know how
to refer to the file name.
Here is an example of what I am trying to do.
List of files: file1(A,B,C, D1...Dn), file2(A,B,C,E1,...,En),
file3(A,B,C,F1,...,Fn)
Procedure I want to apply on each file:
dft <- melt(df,id=c('A','B','C'))
dft$X <- substr(dft$variable,1,3)
dft$Y <-
2008 Aug 06
4
Font size in plots (I do NOT understand par help)
Hi,
I do not get how par works, help please.
Let's say I have a simple plot: plot(1:10)
I want to change the font size for the x axis... how do I do that?
Thank you,
Stephane
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
compa
ny registered in England with number 2742969,
2008 Jun 29
1
creating a dataframe using a list of the variable names
Hello,
I'm fairly new to R, and despite spending quite some time exploring, testing, and looking for answers, I still have a couple of questions remaining...
The first one is about creating a dataframe using a list of the variable names .
I get this output file from a database:
BOB <- c('A/A', 'C/C', '15/27')
MARY <- c('A/A', NA, '13/12')
JOHN
2003 May 09
3
rsync of symbolic links bug
I am seeing a problem with the way the rsync of symbolic links
is done. Here is a simple example to duplicate this issue:
prompt> # Create a test case to show rsync of symbolic link problem
prompt> mkdir foo bar
prompt> touch foo/file1 bar/file2
prompt> ln -s bar/file2 file
prompt> rsync -av . ../duplicate
building file list ... done
created directory ../duplicate
./
bar/
2008 Sep 29
2
density estimate
Hi,
I have a vector or random variables and I'm estimating the density using
"bkde" function in the KernSmooth package. The out put contains two vectors
(x and y), and the R documentation calls y as the density estimates, but my
y-values are not exact density etstimates (since these are numbers larger
than 1)! what is y here? Is it possible to get the true estimated density at
each
2004 Apr 21
2
Resizing a ListCtrl
Hi Guys,
I''m having serious troubles resizing a dialog with a ListCtrl. The ctrl
will not resize horizontally no matter what I''m doing. I''ve attached a
sample code below. Any help will be greatly appreciated, as I really
like wxRuby :)
I''ve also tried to copy from the example from listtest.rbw, but that
also doesn''t seem to work.
Another thing
2007 Nov 15
2
font formating
I am tryindo to do a very simple thing but cannont find how to do it
anywhere. I need to formap part of my title as subscript ans superscript.
How can I do it?
Thanks a lot in advance
José
--
MSc José Alberto F. Monteiro
Botanisches Institut
Universität Basel
[[alternative HTML version deleted]]
2012 Jun 18
1
Changing many csv files using apply?
Dear all,
I have many csv files whose contents I want to change a bit en masse. So far, I've written code that can change them in a for loop, like so:
# Subset of files in the folder I want to change
subset = "somestring"
# Retrieve list of files to change
filelist=list.files()
filelist = filelist[grep(subset, filelist)]
for(i in 1:length(filelist)){
setwd(readdir)
2011 Dec 12
4
Improve a browse through list items - Transform a loop to apply-able function.
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20111212/5611c696/attachment.pl>
2003 Feb 12
2
Filelist caching
Hi,
I've noticed every time someone does an rsync-request on my ftp-site
(which also provides rsync as mirror method), rsyncd creates a filelist.
This is a quite IO and CPU intensive procedure, especially for things
mirrors like FreeBSD with lots of little files.
I was wondering... is there a way to cache that filelist? Our mirrors
are updated once, or twice a day, it could speed up
2008 Sep 23
3
odds ratio: how to create reference
HI there,
i know this is a basic question, though i need some help because this
is somewhat away from my current issue, but nevertheless interesting
to me... Lets assume i have some estimated probabilities, say
estimated by a logit model. i know i can also state them as an odds
ratio.
Now i?d like to state these odds ratios as a reference to a specific
outcome of my investigated
2010 Feb 19
3
Plotting multiple table automatically
Hi All,
I have a slight issue getting R to plot a series of tables automatically.
Essentially I have a series of tables that I wish to plot. They are named
on_2, on_3 etc. based on the file name when they were read in. I have
filelist <- list.files() to give me list of the table names. I wish to plot
each table, so I was thinking along some kind of for loop as below:
for (i in 1:Number_Files)
2009 Mar 23
2
Looping of read.table and assignment
Dear all,
I am trying to read in and assign data from 50 tables in an automated fashion. I have the following code, which I created with the help of textbooks and the internet, but it only seems to read in the final data file over and over again. For example, when I type:> table_1951 I get the same values in the table as when I type> table_2000 despite the values in the source tables
2009 Mar 27
2
Assignment to variables fails to loop
Dear all,
I think I'm nearly there in writing R code which will read in files with two variable parts to the file name and then assigning these file names to objects, which also have two variable parts. I have got the code running without encountering errors, however, I receive 50+ of the same warnings:
1: In assign(paste("Fekete_", index$year, index$month, sep = ""),
2024 Nov 06
1
Using multiple dat files
"It seems therefore that there is no other way than read in individually >
100 weather tables using read.tables., right? Using file.choose() doesn't
change the work."
Yes. With that many files, file.choose() does not make sense. However, I
still do not understand what is the problem with using lapply() on the
character vector of file names with read.table() as you did in your
2009 Apr 07
4
group by-like statement for 2-row matrix
Hi,
my problem is as follows:
I have a matrix of two rows like this:
2 2 3 4 4 4 5 5 6
1 1 2 1 3 3 2 1 1
Can I apply something like "group by" in sql? What I want to achieve
is the some of second row for each unique entry of first row:
2 -> 2 (=1+1)
3 -> 2
4 -> 7 (=1+3+3)
5 -> 3 (=2+1)
6 -> 1
Thanks!!
Henning
2005 May 24
1
Contingency tables from data.frames
Dear list,
I'm trying to do a set of generic functions do make contingency tables from
data.frames. It is just running "nice" (I'm learning R), but I think it can be
better.
I would like to filter the data.frame, i.e, eliminate all not numeric variables.
And I don't know how to make it: please, help me.
Below one of the my functions ('er' is a mention to EasieR,
2007 Dec 26
1
scope of plugns
After more than one hour of countless tries, I ask myself a simple question :
On what items are plugins supposed to execute ?
I''ve tried to create a filelist plugin which, for a page, displays all
file in the same directory (a rather old school view of website, where
each directory contains an entry point).
But, whatever I try, my plugin code is never invoked, and my page
content is never