Displaying 20 results from an estimated 400 matches similar to: "Help on a matrix task"
2006 Sep 06
4
histogram in the background?
I intend to draw a plot of y against x. In the background of this graph I
wish to creat a histogram of the horizontal variable x. Does any expert know
how to produce such a plot?
[[alternative HTML version deleted]]
2006 Jul 25
2
convert decimals to fractions - sorted
Dear all,
Based on my question a few months ago
https://stat.ethz.ch/pipermail/r-help/2006-January/086952.html
and solved with
https://stat.ethz.ch/pipermail/r-help/2006-January/086955.html
https://stat.ethz.ch/pipermail/r-help/2006-January/086956.html
and from
https://stat.ethz.ch/pipermail/r-help/2006-January/086958.html
frac.fun <- function(x, den){
dec <- seq(0, den) / den
nams
2006 Jun 30
1
tkbutton command - how to know which button was clicked?
In the below code fragment, print(arg) always prints the
last element of rekeningen$rekening.
Is this because of lazy evaluation? I.e. arg is evaluated at
the time the button is pressed?
And, if so, how can I avoid this?
I tried function() {force(arg); print(arg)} but that didn't work either.
Thanks,
Jeebee.
for(rek in seq(1,nrow(rekeningen))) {
arg <- rekeningen$rekening[rek]
2006 Feb 01
1
several plots in one
Can anyone tell me how I can supply more than one graph to plotCI
(gplots) at once?
Below is what I tried, also with rbind instead of cbind.
What is the way to do this (in general, I think)?
Problem is that lines of 1-st and 2-nd series are mixed, while they have
nothing to do with each other.
I also tried calling plotCI with argument add=TRUE, which didn't seem to
work (that is actually
2005 Nov 10
4
write.table read.table with Dates
I've found several similar issues with write.table/read.table
with Dates on this list, but trying to follow this advice I still
get an error.
First, I read in data from several files, constructing several date/time
columns using ISOdatetime
> str(Tall$Begin)
'POSIXct', format: chr [1:40114] "2005-10-02 00:00:00" "2005-10-02
00:00:00" ...
> length(Tall$Begin)
2006 Oct 16
2
set linetype with plotCI
Dear R-list,
I'm iterating several calls to plotCI [gplots], like so:
plotCI(
x = xvals.f[sorted],
y = yvals.f[sorted],
xlim = c(xmin, xmax), ylim = c(ymin, ymax),
pch = plot_symbols[graph_idx], type = "b",
lty = plot_linetypes[1],
col = plot_colors[graph_idx],
barcol = plot_colors[graph_idx], uiw = NA,
xlab = "", ylab = "",
add =
2006 Aug 09
1
tk combobox question
Hello!
The IWigdets::combobox has an option "selectioncommand" to specify a procedure
which is called when an item in the combobox is selected.
Does ComboBox from Bwidgets have an equal option or is there a simple method to
do thi? I haven't found one but i would like to use Bwidgets instead of Iwidgets.
Another question which should not be a problem, but at the moment I just
2010 Aug 19
1
Adding column to dataframe
Two questions:
1) Are there any good R guides/sites with information/techniques for dealing
with large datasets in R? (Large being ~2 mil rows and ~200 columns)
2) My specific problem with this dataset.
I am essentially trying to convert a date and add it to a data frame. I
imagine any 'data manipulation on a column within dataframe into a new
column' will present the same issue, be it
2008 Apr 23
1
cbind speed.
cbind/ rbind/ data.frame functions are very convenient for merging
vectors of different types into a single data frame, but take quite a
bit of time to execute on larger data sets.
Is it possible to speed these up a bit?
What functions do you use instead?
Thanks & regards,
Charles
2006 Nov 14
1
greatest common substring
Dear R-members,
Suppose I have a vector with the following strings:
V = c("Welfare_Group_1024",
"Welfare_Group_1536",
"Welfare_Group_160")
I want to 'automatically generate a nice y-axis label for this data.
A good candidate is something close to "Welfare Group".
Is there an easy way to compute something close to the greatest
common
2006 Jun 15
1
R with tcl/tk 8.5
Hi List,
Is it possible to tell R to use tcl/tk 8.5?
My R package seems to depend on libtcl8.4.so.
However, in Windows it seems to be possible to set
TCL_LIBRARY and MY_TCLTK.
Is there something similar possible in Linux?
I have installed:
$ rpm -q R
R-2.3.1-1.fc5
$ locate libtcl8
/usr/lib/libtcl8.4.so
/usr/local/lib/libtcl8.5.so
2005 Nov 24
1
hamming distance
Hi,
Does anyone know an R function to impute hamming distance?
Thanks
Ana
O@@@@@ &nb @@@O@@O@ Centro de Gen?mica
@O@@@@O@ Instituto Valenciano de Investigaciones Agrarias (IVIA)
@@@O@@@@ Carretera Moncada - Naquera, Km. 4,5
@@@@O@ 46113 Moncada (Valencia) SPAIN
|| & || &
2005 Dec 12
2
date handling
Hi,
Given a frame with calendar date's:
"2005-07-01", "2005-07-02","2005-07-03","2005-07-04","2005-07-05",etc.
I want to extract the following from these dates:
week number
month number
year number
Any ideas how to accomplish this?
Many thanks.
Regards,
Richard
2005 Dec 13
1
sample matrix as a new object
Please, I??d like to store this sample matrix as a new object. How can I
do this ?
pulse <- c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71,
71, 72, 72, 73, 74)
m <- NULL
x <- 0
for (i in 1:5)
{
x <- sample(pulse,3)
m <- mean(x)
cat(x,m,"\n")
}
Thanks,
Mauricio
2006 Jun 15
1
Compact sums in functions definitions
I'm trying to make more compact the definition
of a function as for example:
f <- function(x) 2/x+3/x
by simply defining the array of coefficients
arr = c(2,3)
and setting:
g <- function(x) sum((arr/x))
Everything seems to work fine because the values returned
by f and g result coincident for different values of their
argument, but when I try to plot the function g using:
x =
2006 Jun 22
1
Basic NA handling problem
Hi All,
I need your help in NA handling.
I've following data series.
x<-c(1,4,5,8,NA,4,NA,5,5,1,2,7,8,9,NA,NA,NA,15,6,8)
Now i want to interpolate where NA value persists. Like, between 9 and 5 there are three NA's. So, that should be interpolated like,
1st NA-> (15-9)/4
2nd NA-> 1st NA value + (15-9)/4
Can i get help on this using a 'for' loop. Actually i have huge
2006 Jun 22
1
Strings to Numbers?
I am running the following command.
for( i in 1:378){
for (j in 1:5) {
*********Year [((i-1)*5)+j,1]<- yearly[i,2];*********
Year [((i-1)*5)+j,2] <- j;
Year [((i-1)*5)+j,3] <- yearly[i,(j+2)];
j <- (j+1);
}
i <- (i+1)
}
The array referenced yearly[i,2] contains conference names i.e. BIG12,
SEC, BIG10. The loop executes fine except for the fact that
2006 Jun 30
1
apply a function to several lists' components
Dear R-user
I have 100 lists.
Each list has several components.
For example,
>data1
$a
[1] 1 2
$b
[1] 3 4
$c
[1] 5
There are data1, data2,...., data100. All lists have the same number and the
same name of components.
Is there any function I can use for applying to only a specific component
across 100 lists?
(e.g., taking mean of $c acorss 100 lists) or do I need to write my own
2006 Aug 01
2
Extracting a row number from a matrix
Hi all,
I have a matrix with each column containing a large number of integers
(0 and above). in each column beyond a certain row (say row 120 in
column 1, row 134 in column 2, 142 in column 3...) there are only
0's. I want to find, for each column the row number of the last row
which contains a positive integer beyond which there are 10 or more
0's.
so in the following example (single
2006 Aug 01
1
How to convert two-dimensional function to matrix?
I'd like to convert a two-dimensional function f(x,y) to a matrix m,
so that m[x,y] = f [x,y]. How can I achieve this?
Thanks,
Lothar