Displaying 20 results from an estimated 20000 matches similar to: "0 * NA = NA"
2007 Feb 28
3
matrix manipulations
Dear friends,
I have a basic question with R. I'm generating a set
of random variables and then combining them using the
cbind statement. The code for that is given below.
for (i in 1:100)
{
y <- rpois(i,lambda=10)
X0 <- seq(1,1,length=i)
X1 <- rnorm(i,mean=5,sd=10)
X2 <- rnorm(i,mean=17,sd=12)
X3 <- rnorm(i,mean=3, sd=24)
ind <- rep(1:5,20)
}
2007 Oct 10
5
chi2
Hello,
I want to use the quantile function so I read the doc but I don't understand with this
> qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1))
[1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53 63550.14 63619.68
[18] 63707.24 63837.16
Can you help me please?
2007 Jun 13
3
extractor rows from a matrix
hi!
i have a little problem: my data's matrix has 1093 rows and 3 columns.
i'd like to extract each rows..
something like this:
ht= my matrix
Dt=(???)=a vector with t=1,2...1093
what can i do?
thank you!
Vincenzo
--
View this message in context: http://www.nabble.com/extractor-rows-from-a-matrix-tf3913088.html#a11094459
Sent from the R help mailing list archive at Nabble.com.
2007 May 16
3
Filled step-function?
Hello,
I'd like to generate a filled step-function in R as you can see in the
attachement (image is generated by grapher, but I need a freely
available alternative). The problem is, that I don't know, how to fill
it up. My code right now looks like this:
pH <- c(0,6.1,6.1,6.3,6.6,7.3,0)
Tiefe <- c(0,0,10,40,80,120,10)
plot(pH,Tiefe,type="s",main="Tiefenfunktion
2009 Oct 22
2
Simple extraction of level,x,y from contourLines()
A follow-up to my previous query.
Say one of the results returned by contourLines() is
C.W <- contourLines(....)
Then C.W is a list of (in this case 28) lists,
each of which is a list with components $level (a single number),
$x (the x coords of the points on a contour at that level) and
$y (the y coords).
I can of course get these individually with, for the 5th one for
instance,
2007 Apr 16
3
session log
Hi,
is there a platform independent way to log a complete R session (input +
output + warnings + errors + ???) into a text file? I can use sink(file,
split=T) and savehistory() but it is quite cumbersome to merge the files
and still there is some loss (eg. warnings).
I wondered that I only found this thread from 2003(!) related to this topic:
2007 Mar 23
5
Get "home" directory and simple I/O
Is there any generic function that gets the "home" directory? This
should return /home/<user> in Linux and
x:/Documents and Settings/<user> (or whatever) in Windows XP.
Another (unrelated) question: what is the _simplest_ way to
read and write R variables to/from files such that they are
stored in a human-readable but R-like form? For example, if
(say), x is a vector
2008 Apr 29
4
XML write?
Is there any function to write a XML structure, after it was
read using xmlTreeParse?
Ex:
library(XML)
x <- xmlTreeParse("Irpf2008/aplicacao/dados/12345678901/12345678901.xml")
# write it...
Alberto Monteiro
PS: please, brazilians, don't be offended by my foul language!
2007 Feb 28
3
get more than get
This must be a stupid question, but is there any "extension" of get?
For example:
x <- 10
get("x") # gives me 10
get("x^2") # gives me an error
Alberto Monteiro
2007 Jul 06
1
Recursion in R ...
Hi Folks,
R has known speed issues for recursive definitions.
There was a thread "Extremely slow recursion in R?" in
August 2006 (24 Aug, from Jason Liao), with some
interesting comparisons between programming languages.
I'm re-opening the topic, with an ulterior motive
(stated at the end).
The starting point was the question "How many distinct
increasing sequences of length
2009 Apr 24
1
Terminology: Multiple Regression versus multivariate Regression
Hello R-Members,
can anyone explain the difference between
multiple and multivariate regression to me
in terms of the terminology and eventually
its respect to the mathematical foundation
respectively ?
Is multiple regression perhaps more related to GLM
and multivariate Regression rather applied,
if there are no explizit numeric factor levels ?
Thanks for elucidations on that topic.
Many
2007 Mar 06
2
Package RODBC
I have some questions about the RODBC package.
library(RODBC) # required for those who want to repeat these lines
1st, I noticed that the following sequence does not work:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlFetch(channel, name1) # bang!
2007 Jul 05
4
Me again, about the horrible documentation of tcltk
How on Earth can I know what are the arguments of any of the functions of
the tcl/tk package? I tried hard to find, using all search engines
available, looking deep into keywords of R, python's tkinter and tcl/tk, but
nowhere I found anything remotely similar to a help.
For example, what are the possible arguments to tkgetOpenFile?
I know that this works:
library(tcltk)
filename <-
2008 Jun 06
2
Plot matrix as many lines
Suppose that I have a matrix like:
m <- rbind(c(1,2,3,4), c(2,3,2,1))
Is there any way to efficiently plot the _lines_ as if
I was doing:
plot(m[1,], type="l")
points(m[2,], type="l", col="red")
(of course, in the "real world" there much more than
just 2 lines and 4 columns...)
Alberto Monteiro
2008 Jun 10
2
A curious bug in read.xls
I found a curious bug in read.xls. I don't know if it's reproducible.
It's like this: suppose I do a read.xls in a spreadsheet. A column
begins with a number. Then, any strings below it will be rendered as NA.
If the column begins with a string, then it will be rendered correctly.
Alberto Monteiro
2008 Sep 30
2
plot inside graphic area
I am trying to plot a small graphic inside the graphic area of a bigger
graphic. Does anybody know the commend for that?
Thanks a lot!
--
MSc José Alberto F. Monteiro
Botanisches Institut
Universität Basel
السلام عليكم
[[alternative HTML version deleted]]
2007 May 20
4
Running an R script without running R
Is there any way to run an R script without running R?
As an example, suppose I have a tcl/tk interface that asks
for a number (in a GUI) and displays its factorial. Is there a
way to invoke this script without invoking R?
I'm using R 2.4.1 in GNU/Linux Fedora Core 4.
Alberto Monteiro
2007 Jul 16
2
Source inside source
Is there a way to know where is the source, so as to make a source call
inside another source smarter?
As an example:
file1.R is in directory /files/dir1/
file2.R is in directory /files/dir1/dir2/
In file1.R, there is this line:
source("dir2/file2.R")
So, if I setwd to /files/dir1/, and then I call source("file1.R"),
it will run correctly. However, if I setwd to /files,
2007 Mar 30
3
RWiki, tcltk and plot
I think I - almost - got the knack for GUI programming using the
tcltk library. Maybe I will update the RWiki with this:
#
#################################################
#
library(tcltk)
#
# Create some matrix - nothing about tcltk here
#
matrix <- cbind(rnorm(100), rpois(100, lambda=10),
runif(100), rt(100, df=2), rt(100, df=4))
colnames(matrix) <- c("Normal",
2006 Oct 05
5
[Fwd: Re: Block comments in R?]
Ooops! Sorry, I send it only to Uwe Ligges the first time.
Best,
Philippe Grosjean
This is perhaps another solution, more elegant in the way the block
comment is written... but it requires to redefine `!` and slows it a
little bit because it tests first its arguments before calling
.Primitive(!):
It takes advantage of `!` being not defined for character arguments:
> !2
[1] FALSE
>