Displaying 20 results from an estimated 10000 matches similar to: "Teaching R - In front of the computer?"
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 Jul 22
3
Replace only Capital Letters
Dear All,
I have these data:
exampledata <- c("This is one item", "This is Another One", "And so is
This")
I would like to find each occurence of a blank space followed by a Capital
Letter and replace it by a blank space, a left curly brace, the respective
Capital Letter, and then a right curly brace.
I thought the following will do:
gsub(pattern = "
2005 Aug 17
2
power of a matrix
Dear all,
I have a population with three age-classes, at time t=0 the population
is:
n.zero <- c(1,0,0)
I have a transition matrix A which denotes "fertility" and "survival":
A <- matrix(c(0,1,5, 0.3,0,0, 0,0.5,0), ncol=3, byrow=TRUE)
To obtain the population at t=1, I calculate:
A %*% n.zero
To obtain the population t=2, I calculate:
A %*% (A %*% n.zero)
... and so
2006 Jul 14
2
References verifying accuracy of R for basic statisticalcalculations and tests
Hi,
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Corey Powell
>
> Do you know of any references that verify the accuracy of R
> for basic statistical calculations and tests. The results of
> these studies should indicate that R results are the same as
> the results of other statistical packages to a certain number
> of decimal places on some benchmark
2005 Feb 03
2
Surprising Behavior of 'tapply'
Dear all,
I wanted to make a two-way-table of two variables with a counting
variable stored in another column of a dataframe. In version 1.9.1, the
behavior is as expected as shown in the simplified example code.
> sex <- rep(c("F", "M"), 5)
> income <- c(rep("low", 5), rep("high", 5))
> count <- 1:10
> mydf <-
2005 Oct 27
3
outer-question
Dear all,
This is a rather lengthy message, but I don't know what I made wrong in
my real example since the simple code works.
I have two variables a, b and a function f for which I would like to
calculate all possible combinations of the values of a and b.
If f is multiplication, I would simply do:
a <- 1:5
b <- 1:5
outer(a,b)
## A bit more complicated is this:
f <-
2005 Oct 27
3
outer-question
Dear all,
This is a rather lengthy message, but I don't know what I made wrong in
my real example since the simple code works.
I have two variables a, b and a function f for which I would like to
calculate all possible combinations of the values of a and b.
If f is multiplication, I would simply do:
a <- 1:5
b <- 1:5
outer(a,b)
## A bit more complicated is this:
f <-
2005 Dec 08
3
Reshaping data
Dear all,
given I have data in a data.frame which indicate the number of people in
a
specific year at a specific age:
n <- 10
mydf <- data.frame(yr=sample(1:10, size=n, replace=FALSE),
age=sample(1:12, size=n, replace=FALSE),
no=sample(1:10, size=n, replace=FALSE))
Now I would like to make a matrix with (in this simple example)
10 columns (for the
2005 Feb 21
3
Sorting a matrix on two columns
Hello,
If a matrix with 5 columns has been defined and the first two columns
need to be sorted in ascending order, how can this be achieved whilst
ensuring the
other 3 columns data are in relative position to the sorted columns?
Glen Jones
[[alternative HTML version deleted]]
2005 May 19
5
Arranging Plots
Dear all,
I'd appreciate any hints how to arrange some plots.
I have three plots. I would like to arrange them in the following order:
- Plot 1 and Plot 2 should be in the upper row
- Plot 3 should be in the lower row but centered in the middle.
I hope the following sketch will help understanding my problem
================
| === === |
|| P1| |P2 | |
|| | | | |
| === === |
2005 Nov 23
2
Dancing lissajous
We can't post images here so I've put up a web page to show off a neat
little animation in R:
http://www.geocities.com/robsteele/
Adios!
2006 Mar 14
1
Tiny Typo in R Data Import/Export Manual
Dear all,
in the first paragraph in Section 4.3.2 of the "R Data Import/Export
Manual", it is written 'We havew tested...'. Most likely it should be
'We have tested...'
It is just such a minor thing that I was unsure whether to submit a bug
report.
I use now R 2.2.1 on Win32 but I guess this is independent of the
platform and version.
Best,
Roland
P.S. Thanks for
2004 Aug 12
9
Giving a first good impression of R to Social Scientists
Dear all,
in the coming Winter Semester, I will be a teaching assistant for a course
in Survival Analysis. My job will be to do the lab sessions. The software
used for these lab sessions will be R. Most of the students have a
background in social sciences and the only stats package they used so far is
most likely SPSS.
So I assume they might be quite surprised the first time they see R
2006 May 29
1
OT: Monograph on Statistical Programming
Dear all,
my question might be a bit off-topic.
Is there anything like a standard textbook on statistical programming?
With that I don't mean anything like MASS, S Programming, Programming
with Data, ... (no offense meant, they are fantastic books and each of
those three helped me a great deal).
Rather in the direction of the "Numerical Recipes" Series addressing how
to implement
2004 Dec 21
1
No Graphics Window, Mandrake 10.1
Dear all,
I installed Mandrakelinux 10.1 (community) on my notebook. Before, I
used Mandrakelinux 9.1 (and later 10.0 as an update).
Now I wanted to compile, as before, R.
In the beginning, nothing worked but it seemed to be the problem of GCC
3.4.1 which was shipped with my distribution. After downloading and
compiling GCC 3.4.3 everything went smoothly during the compilation of
R.
The problem
2006 Mar 09
1
Linking Rblas
Dear all,
when making a DLL via Rcmd SHLIB is there a way to link against a
library such as Rblas (I am on a Windows platform) on a case to case
basis?
I played a bit around with some self-written C-code which should call
the function 'dasum' defined in Blas.h.
I encountered the following problem:
u:\codeplay>Rcmd SHLIB mysumming.c
Rcmd SHLIB mysumming.c
gcc --shared -s -o
2005 Apr 26
11
good editor for R sources ?
Dear all,
(Sorry if the question has already been answered.)
Could someone please suggest a good text editor for
writing R sources ?
(I know emacs exists ... but I find it a bit heavy).
I use crimson (http://www.crimsoneditor.com) which is
small and simple, but the R syntax seems not to be supported.
Thanks for any advice
2009 Jan 18
8
regex -> negate a word
Dear all,
let's assume I have a vector of character strings:
x <- c("abcdef", "defabc", "qwerty")
What I would like to find is the following: all elements where the word
'abc' does not appear (i.e. 3 in this case of 'x').
Since I am not really experienced with regular expressions, I started
slowly and thought I find all word were
2005 Feb 04
5
simple example of C interface to R
i'd like to use the C interface to R in a program i'm writing. as a
starting point, i'm trying to create a very simple C program that uses
R. i've read the R documentation on this, but i'm having trouble
figuring out where SEXP is defined and how to use it.
i noticed someone else on this list also tried to use the C interface,
but they ran into similar problems:
2009 Jan 29
3
Plot dagger symbol in R
Dear all,
I would like to plot the dagger symbol in R (like LaTeX's \dagger).
However, I was unable to do so.
First, I thought maybe dagger actually exists just like the degree
symbol:
plot(0:1,0:1, type="n")
text(x=0.5, y=0.5, labels=expression(degree))
plot(0:1,0:1, type="n")
text(x=0.5, y=0.5, labels=expression(dagger))
However, this was not very successful. New