Displaying 20 results from an estimated 8000 matches similar to: "Updating selected variables in a data frame"
2003 Oct 30
1
Trouble reshaping some data
I would appreciate some advice on the following task. I have
some data that currently looks like this:
t1 <- data.frame(id=c(1,1,2,2),
aspect=c("A","B","A","B"), score=c(10,9,11,12))
I'd like it to look like this:
id A B
1 10 9
2 11 12
reshape() looks like a good candidate for this job but I'm
not really sure about the roles of
2003 Sep 04
2
laplace transform
Dear users,
is anybody of you aware of a R command to perform laplace transform or
even its inversion?
Thank you very much.
Luca
2003 Jul 22
3
R and C++ compared with only C++
My computer is a pentium 4 running at 2.4 GHz.
My R is 1.7.1
I have written a program in R that calls C++. The program spends most of the
time in C++ ( > 90% ). R basically deals with output and input.
How slower can this be compared with the program I would get from rewriting
everything in C++?
Thank you.
2003 Aug 01
2
'format' problem
Dear R experts,
format(12345678, digits = 2)
gives
[1] "1.2e+07"
while
format(1234567, digits = 2)
gives
[1] "1234567"
but I'd like the last number to be represented as "1.2e+06" string too.
Where am I wrong?
Thanks,
Timur.
2008 Dec 15
2
Duplicates among columns of a data frame
Dear list,
I have a data frame of survey respondents, a little like this:
set.seed(20081215)
n <- 100
dat <- data.frame(id=1:100,
addr1=sample(LETTERS, n, replace=TRUE),
addr2=sample(LETTERS, n, replace=TRUE),
addr3=sample(LETTERS, n, replace=TRUE))
head(dat)
id addr1 addr2 addr3
1 1 R H Q
2 2 H C K
3 3
2001 Nov 23
1
Changing strip widths in lattice plots
Hello R users,
I'm using xyplot (lattice) to plot some data. Unfortunately, the text that goes
into each strip is often too big to fit. For instance, one of the factors may
be labelled "Satisfaction with waiting time" which is too wide to fit. If I use
split.string() to wrap it onto two lines it is then too high to fit in the
strip. I'd prefer to apply split.string on the
2001 Dec 11
1
Paid support for R?
Dear R users,
Sorry if this has been discussed before.
I was recently looking at the MySQL site and saw that they offer various levels
of paid support. The support options range from basic email support (USD200)
through to extensive telephone support from the development team (USD10000).
These are annual prices.
This is something I would be happy to see available with R (maybe it is?). My
2002 Jul 23
3
Aggregate: assembling the "by" part on the fly
Dear R users,
I'm having trouble using aggregate() and would
greatly appreciate your advice. I am using R 1.5.1
on Windows 2000.
I want to call my function in the following way
extract.data(x=dat[, "Age", "Year"])
where extract.data() uses aggregate() to count the number
of cases for each combination of "Age" and "Year".
I've defined
2003 Aug 21
5
graphic widow overwrite
Hi,
I am running a loop to plot multiple plots. In s-plus,
it shows multiple pages in the graphic window to allow
checking on each plot. but in R, the next plot always
overwrite the previous one, so i can only have the
last plot produced, is there a way to have multiple
pages in the graphic window just like S-plus does?
Thanks
2003 Apr 24
5
Fast R implementation of Gini mean difference
I have written the following function to calculate the weighted mean
difference for univariate data (see
http://www.xycoon.com/gini_mean_difference.htm for a related
formula). Unsurprisingly, the function is slow (compared to sd or mad)
for long vectors. I wonder if there's a way to make the function
faster, short of creating an external C function. Thanks very much
for your advice.
gmd
2002 Jul 06
3
one-sample binomial test
Hi everyone,
Here's how I solved a problem for my stats class. I'm pretty sure I
understand what's going on, but I wonder if there's a more direct way to
solve it.
Problem summary:
A recent poll indicated that Candidate A is leading B with 55% of the
vote. How many voters need to be surveyed to ensure a margin of error of
+/- 2.5% with 99% confidence.
Here's what I did:
2003 Jul 30
6
reverse array indexing
Hi,
Suppose I have a multidimensional array:
tmp <- array(1:8, c(2,2,2))
is there a function out there that, given a one-dimensional array index,
will
return the separate indices for each array dimension?
for instance, tmp[8] is equivalent to tmp[2,2,2]. I'd like to derive the
vector (2,2,2)
from the index 8.
thanks,
Brad Buchsbaum
2005 Dec 05
1
count.fields vs read.table
Dear R-help,
I am using R 2.1.1 on Windows XP.
I have a tab-delimited data file that has been exported by SAS. The file is reasonably big so I
apologise that I can't give a good toy example. I do this:
table(count.fields("t1.txt", sep="\t", quote="\""))
248
809
So I have 809 lines, each with 248 fields.
There's something wrong with
2003 May 02
3
letters to numbers conversion
Hello List
How do I turn
R> simple.example.alphabetic
[,1] [,2] [,3]
[1,] "a" "b" "c"
[2,] "d" "e" "f"
[3,] "g" "h" "i"
into
R> simple.example.numeric
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 4 5 6
[3,] 7 8 9
[ie "a" becomes 1, ..., "z"
2003 Aug 10
3
high memory allocation
Hello,
I have trouble with my cluster analysis using package "cluster". "diana" and "agnes" both seem to try to allocate memory directly, so I can not use virtual memory of my Windows2000 operation system.
I do have 320 MB of memory. But they claim about 600 MB. Do I have a chance to do the analysis with my amount of memory.
Thanks for all comments, I did not find a
2002 Oct 24
4
plot slow?
Hi,
I just installed R and am comparing it to other packages (such as Igor).
So, you'll have to excuse me if this is a stupid question. I run the
simple command:
plot(1:1000000)
And it seems SO slow! Igor blasts through this.
My theory is that R is redrawing the screen for every point that's being
graphed. Is it possible to control how often R redraws a plot as its
building it -
2001 Aug 28
2
Christmas tree graphs
Hello R users,
I wish to draw a type of horizontal bar chart for two groups (males and
females). The values for one group will start at the y-axis and point to the
left, and the values for the other group will start at the y-axis and point to
the right. If you're (un)lucky, the resulting graph can assume the shape of a
Christmas tree.
The data are
left.side <- c(107092, 113053,
2003 Sep 03
1
Call R function from C code
I am participating in a project in the university, and appeared a doubt: if can I call one function from R as "solve" from C code.
The intention of the research is to create a DLL.
Is it possible and where can I find an example?
Sorry for bad english!
___________________________________________________________________________________
Acesse nosso portal www.click21.com.br
Porque
2003 Jul 31
2
history for graphics
I've seen that there's an history for graphics.
How can I save it manually?
Can I save more than 4 plots?
I'm using R1.6.2 under win98
[[alternative HTML version deleted]]
2003 Jan 31
1
Help on Scatte Plot Matrix
Hey, All
Now I have a data set which is n-dimensional.
And want to plot the Scatter Plot Matrix which
is n by n.
Does R have such function to achieve this?
Thanks for your point.
Fred