Displaying 20 results from an estimated 10000 matches similar to: "scan() Bug?"
2004 Sep 24
3
Error with repeat lines() in function
I have a function that does some plotting. I then add lines to the
plot. If executed one line at a time, there is not a problem. If I
execute the function, though, I get:
Error in ans[[1]] : subscript out of bounds
This always occurs after the second lines command, and doesn't happen
with all of my data points (some do not have errors). Any ideas?
Thanks,
Sean
2005 May 25
3
Rounding fractional numbers to nearest fraction
Hi all,
I've got a matrix of fractional data that is all positive and greater than
zero that I would like to "loosely" classify, for lack of a better word. It
looks something like this :
1.07 1.11 1.27 1.59 0.97 0.76
2.23 0.98 0.71 0.88 1.19 1.02
What I'm looking for is a way to round these numbers to the nearest 0.25,
i.e. the above matrix would be
2003 Jun 19
1
Problem reading a PDF output
I generated a PDF output file of 10 plots. When I try to view it with
Adobe reader (R4 & R5), it will lockup the reader (it is consuming 100% of
the CPU) after presenting the 4th plot. I can generate the plots just fine
in Windows and as a postscript file reading it with GSview.
Is there anyway to tell what might be wrong with the PDF output? The file
is 890KB in size if anyone would like
2004 Oct 07
3
Read.Table Reading a Text file
Dear R users and Helpers
I am beginner with using R and interested in carrying out certain task for my statistical research.
I am reading data for a text file, which could contain data in following pattern
x y
8 10
11 14
16 16
18 15
6 20
4 4
20 18
As per the example I have two columns and 7 rows of data in each.
However is real life data situation I may not know how many columns are present
2005 Jan 21
6
Avoiding a Loop?
Dear R-Helpers,
I have a matrix where the first column is known. The second column is
the result of multiplying this first column with a constant "const". The
third column is the result of multiplying the second column with
"const".....
So far, I did it like this (as a simplified example):
nr.of.columns <- 4
myconstant <- 27.5
mymatrix <- matrix(numeric(0), nrow=5,
2004 Jan 16
2
reference to objects
Hi,
is there a way to reference to a data object without copying it?
For example I have a huge matrix called dist and I want two objects
obj1 and obj2 to have a memeber dist that points to the matrix, but
I don't want, for memory reasons, to copy the matrix twice.
As far as I understand the following code will generate three copies
of my data:
dist <- some_code_that_generates_data
2004 Sep 12
3
calculating error
Could anybody explain this results?
>sin(2*pi)
-2.449213e-16 #should be zero
>(10^16)*sin(log2(4)*pi)
-2.449213 #should be zero too
and explain what to do to correct this events?
Thanks!!!
Branimir K. Hackenberger
2005 Mar 03
4
plot question
I have the following simple situation:
tt <- data.frame(c(0.5, 1, 0.5))
names(tt) <- "a"
plot(tt$a, type = 'o')
gives the following plot ('I' and '.' represent the axis):
I
I
I X
I
I
I X X
I...........
1 2 3
what do I have to change to get the following:
I
I
I X
I
I
I X X
I.....................
1 2 3
2005 Jun 23
3
grep negation
hi,
using the example in the grep help:
txt <- c("arm","foot","lefroo", "bafoobar")
i <- grep("foo",txt); i
[1] 2 4
but how can i get the negation (1,3) when looking for 'foo'?
thanks,
m.
2004 Nov 23
2
How to extract data?
I appreciate if anyone can help me,
I have a table as follow,
> rate
DATE VALUE
1 1997-01-10 5.30
2 1997-01-17 5.30
3 1997-01-24 5.28
4 1997-01-31 5.30
5 1997-02-07 5.29
6 1997-02-14 5.26
7 1997-02-21 5.24
8 1997-02-28 5.26
9 1997-03-07 5.30
10 1997-03-14 5.30
. ...... ...
. ...... ...
. ...... ...
I want to extract the DATE(s) on
2005 Feb 16
4
(no subject)
R-people
I wonder if one could change a list of table with number of the form
1,200.44 , to 1200.44
Regards
JG
------------------------------------------------------------------------------
This e-mail and any attachment may be confidential and may also be privileged.
If you are not the intended recipient, please notify us immediately and then
delete this e-mail and any attachment without
2005 Jun 14
3
Manipulating dates
Hello,
Given a vector of characters, or factors, denoting the date in
the following way: 28/03/2000, is there a method of
1) Computing the earliest of these dates;
2) Using this as a base, then converting all the other dates into merely
the number of days after this minimum date
Many thanks
Richard Hillary
2005 Feb 02
2
Frequency of Data
Hello,
just another problem in R, maybe it's simple to solve for you. I didn't find
a solution up to now, but I'm convinced that I'm not the only one who
has/had a similar problem. Maybe there's a ready-made function in R?
The prob:
I've imported a CSV-file into R with 1000 dates of an observed event
(there's only information of the date. When there happend no
2003 Jul 01
3
lines and legend
When I am trying to put a legend on a plot where I am using "lines", R just
ignores it. I can do it with boxplot or plot, but just not with lines. Am I
doing something wrong? Maybe I am just making a mistake?
Anna
2005 Jun 14
2
Dateticks
Hello. I am having the worst time converting x-axis date ticks to real
dates. I have tried several suggestions in online help tips and books to
no avail.
For example, the x-axis has 0, 50, 100, etc, and I want it to have
"6/17/03", "8/6/03" etc. See attached (sample).
Can anybody help me with this.
Here's my code:
ts.plot(date.attackmode.table[,1],
2003 Oct 09
3
Specifying suitable PC to run R
If I am buying a PC where the most compute intensive task will be running R
and I do not have unlimited resources what trade-offs should I make?
Specifically should I go for
1 - more memory, or
2 - faster processor, or
3 - something else?
If it makes a difference I shall be running Windows on it and I am thinking
about getting a portable which I understand makes upgrading more difficult.
Extra
2005 Jan 05
2
plotting percent of incidents within different 'bins'
Hi
Say I have some data, two columns in a table being a binary outcome plus
a predictor and I want to plot a graph that shows the percentage
positives of the binary outcome within bands of the predictor, e.g.
Outcome predictor
0 1
1 2
1 2
0 3
0 3
0
2004 Dec 03
5
how can I get the coefficients of x^0, x^1, x^2, . , x^6 from expansion of (1+x+x^2)^3
Hi,
I would like to get the coefficients of x^0, x^1, x^2, . , x^6 from
expansion of (1+x+x^2)^3.
The result should be 1, 3, 6, 7, 6, 3, 1;
How can I calculate in R?
You help will be greatly appreciated.
Peter
[[alternative HTML version deleted]]
2005 Jan 14
5
subsampling
hi,
I would like to subsample the array c(1:200) at random into ten subsamples
v1,v2,...,v10.
I tried with to go progressively like this:
> x<-c(1:200)
> v1<-sample(x,20)
> y<-x[-v1]
> v2<-sample(y,20)
and then I want to do:
>x<-y[-v2]
Error: subscript out of bounds.
2003 Sep 17
5
using matrix data for function
Hi All,
I have a function, f(x,y)
I have a matrix of data, m, with the 1st column is x and the 2nd column is y
What's the best way to get f(x,y) for each row of the matrix?
I tried
result<-f(m[,1],m[,2]) but it doesn't work.
Thanks!
Bing
---------------------------------
1060 Commerce Park
Oak Ridge National Laboratory
P.O. Box 2008, MS 6480
Oak Ridge, TN 37831-6480
Phone: