Hi
r-help-boun...@r-project.org napsal dne 20.12.2010 07:07:35:
> Hi,
>
> This must be an easy one but so far I haven't find a way out...
>
> I have a data frame such as:
>
> $ v1: Factor w/ 5 levels
> $ v2: Factor w/ 2 levels
> $ v3: Class 'difftime' atomic [1:]
>
> basical
Hi, Luca,
if V is you data frame, maybe
with( V, tapply( v3, list( v1, v2), sum))
does what you want.
Hth -- Gerrit
On Mon, 20 Dec 2010, Luca Meyer wrote:
Hi,
This must be an easy one but so far I haven't find a way out...
I have a data frame such as:
$ v1: Factor w/ 5 levels
$ v2
Suppose this is my list of transactions:
set.seed(200)
tran=random.transactions(100,3)
inspect(tran)
itemstransactionID
1 {item80}trans1
2 {item8,
item20}trans2
3 {item28}trans3
I want to get the 'transpose' of the data, i.e.
transactionID items
1 {trans2
Hi,
This must be an easy one but so far I haven't find a way out...
I have a data frame such as:
$ v1: Factor w/ 5 levels
$ v2: Factor w/ 2 levels
$ v3: Class 'difftime' atomic [1:]
basically v1 and v2 are factors, while v3 is a variable containing the duration
of certain acti
Stefano Ghirlanda gmail.com> writes:
> I am trying to load into R a MATLAB format file (actually, as saved by
> octave). The file is about 300kB but R complains with a memory
> allocation error:
>
> > library(Rcompression)
> > library(R.matlab)
> Loading required package: R.oo
> Loading required
Hi Jorge,
Yes this was exactly what I was looking for!
Many Thanks!!!
E.
On 20 Dec 2010, at 02:11, Jorge Ivan Velez wrote:
> Hi Enrico,
>
> Is this close to what you want to do?
>
> http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109
>
> HTH,
> Jorge
>
>
> On Sun, Dec 19, 2010
I find this function useful for digging out months from Date objects
Month <- function(date, ...)
factor(month.abb[as.POSIXlt(date)$mon + 1], levels = month.abb)
For this little data set below this is what it gives
> with(data, tapply(value, Month(date), median, na.rm = TRUE))
Jan Feb M
Hi Enrico,
Is this close to what you want to do?
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109
HTH,
Jorge
On Sun, Dec 19, 2010 at 7:03 PM, Enrico R. Crema <> wrote:
> Dear List,
>
> I have a set of distributions recorded at an equal interval of time and I
> would like to p
Many Thanks Dennis,
The distributions are simulated ordinal data all bounded in the same upper and
lower limit, and I wanted to plot how the distribution changes through time.
Since the distributions are often multimodal boxplots were not useful so I made
some violinplots... My practical soluti
Hi:
You can get a violin plot in lattice rather straightforwardly. It's easiest
if time is an ordered factor, but you can also do it if time is numeric; in
the latter case, the code associated with Figure 10.14 in the Lattice book
provides a template to start with:
http://lmdvr.r-forge.r-project.o
On 17/12/2010 4:36 PM, Jeff Breiwick wrote:
All,
I had a simple function call I used to open up a dos shell running R under
Win XP:
system("cmd.exe", wait=FALSE, invisible=FALSE).
This does not work with R 2.12.1 - I get a window that briefly flashes open
but then disappears. Does anyone know t
On 19/12/2010 7:21 PM, Paolo Rossi wrote:
I would like to know how to turn a variable into a string. I have tried
as.symbol and as.name but it doesnt work for what I'd like to do
Essentially, I'd like to feed the function below with two variables. This
works fine in the bit working out number of
Paolo -
One way to make the function do what you want is to replace
the line
print(sprintf("OK with %s and %s\n", var1, var2))
with
cat('OK with',substitute(var1),'and',substitute(var2),'\n')
With sprintf, you'd need
print(sprintf("OK with %s and %s\n", deparse(substitute(var1)),
depa
I would like to know how to turn a variable into a string. I have tried
as.symbol and as.name but it doesnt work for what I'd like to do
Essentially, I'd like to feed the function below with two variables. This
works fine in the bit working out number of elements in each variable.
In the print(sp
Dear List,
I have a set of distributions recorded at an equal interval of time and I would
like to plot them as series of horizontal histograms (with the x-axis
representing time, and y-axis representing the bins) since the distribution
shifts from unimodal to multimodal in several occasions.
Hi:
There is a months() function associated with Date objects, so you should be
able to do something like
aggregate(value ~ months(date), data = data$flow$daily, FUN = median)
Here's a toy example because your data are not in a ready form:
df <- data.frame(date = seq(as.Date('2010-01-01'), by =
Hello,
I have a multi-year dataset (see below) with date, a data value and a flag
for the data value. I want to find the monthly median for each month in this
dataset and then plot it. If anyone has suggestions they would be greatly
apperciated. It should be noted that there are some dates with n
On Dec 19, 2010, at 15:01 , Peter Ehlers wrote:
> On 2010-12-19 03:50, Luca Meyer wrote:
>> I am just wondering why what I am showing below might occur.
>>
>> First I have an x data.frame:
>>
>>> str(x)
>> 'data.frame': 281 obs. of 2 variables:
>> $ x1 : Factor w/ 5 levels "A (50-67%)","B
On Dec 19, 2010, at 3:25 PM, pilchat wrote:
Hello R users,
I am new to R, so this may be a very stupid question. I need to
subscript the dotted circle (Hershey escape sequence "\\SO") to a
string. I tried using
text(.5,.5,substitute( R[disk] == 5 R["\\SO"] ) )
but it turns out to be
On 19/12/2010 2:46 PM, jonathan wrote:
Duncan,
Thanks for the help.
I'm new to R, so I'm not sure how to get R to round the values and "group"
them into larger blocks.
I have tried the following:
xlim=seq(0,2000,100),ylim=seq(0,2000,100)
just to see if it would work, but it doesn't...
Do y
On Dec 19, 2010, at 1:53 PM, Dieter Menne wrote:
David Winsemius wrote:
What's not working? I see two pages output with "the same layout".
The
difference is that in the second case your numbers of groups (subj x
comp) is not an even multiple of your layout numbers, so the 13 subj
leve
Hello R users,
I am new to R, so this may be a very stupid question. I need to
subscript the dotted circle (Hershey escape sequence "\\SO") to a
string. I tried using
text(.5,.5,substitute( R[disk] == 5 R["\\SO"] ) )
but it turns out to be a syntax error.
Do you have any suggestion?
Th
Duncan,
Thanks for the help.
I'm new to R, so I'm not sure how to get R to round the values and "group"
them into larger blocks.
I have tried the following:
xlim=seq(0,2000,100),ylim=seq(0,2000,100)
just to see if it would work, but it doesn't...
Do you think you might be able to explain how
On 19/12/2010 2:10 PM, jonathan wrote:
Sorry to bump this up again, but I've been continuing to look for a solution
to this including a look into stats.bin but I still can't find any solution
to do this within R.
See ?levelplot. The number of bins of x and y is equal to the number of
unique
Hi,
I am trying to load into R a MATLAB format file (actually, as saved by
octave). The file is about 300kB but R complains with a memory
allocation error:
> library(Rcompression)
> library(R.matlab)
Loading required package: R.oo
Loading required package: R.methodsS3
R.methodsS3 v1.2.0 (2010-03-1
Here is an example with ggplot2, which can also be used in a similar way with
lattice. Again, the last page is the problem: the arrangement is correct
here, but the last page (with 1 instead of 5 plots) has a different panel
size which makes a comparison difficult.
And, since I have much more poi
Torch wrote:
>
> Hi,
> is there a function that replaces the following code?
>
> n=200
> boot.x[1]=odhad+boot.res[1] #(boot.x[0]=1)
>
> for (j in 1:(n-1)) {
> boot.x[j+1]=odhad*boot.x[j]+boot.res[j+1]
> }
>
> This is nested in two other loops, and I am looking for some way
Sorry to bump this up again, but I've been continuing to look for a solution
to this including a look into stats.bin but I still can't find any solution
to do this within R.
Any help would be much appreciated!
Thanks,
Jonathan
--
View this message in context:
http://r.789695.n4.nabble.com/lev
David Winsemius wrote:
>
>
>
> What's not working? I see two pages output with "the same layout". The
> difference is that in the second case your numbers of groups (subj x
> comp) is not an even multiple of your layout numbers, so the 13 subj
> levels push 3 of the A's onto the new row
djmuseR wrote:
>
>
> If I read your intention correctly, you need a third element in layout = .
>
> df <- data.frame(month = rep(month.abb, each = 20),
> time = rep(1:20, 12),
> y = rnorm(240))
> xyplot(y ~ time | month, data = df, layout = c(2, 2, 3))
>
>
Hello everybody,
I need to know how often every element in an hierarchical cluster was
"branched" - just imagine a watering pot on the top of the hierarchical
tree -> the leafs should get water according to the number of branches
that lie before them.
For example:
a <- list() # initialize e
Looking at the code shows this is hard coded (function
scatterutil.legend.square.grey or friends are used that make use of
par("usr")[1] and par("usr")[3].
Hence you will have to rewrite the code or even better provide thwe
package maintainer with a patch that allows for arbitrary placemant o
On 19.12.2010 13:20, David Winsemius wrote:
On Dec 19, 2010, at 5:11 AM, Luca Meyer wrote:
Something goes wrong with the week function of the lubridate package:
x= as.POSIXct(factor(c("2010-12-15 17:28:27",
+ "2010-12-15 17:32:34",
+ "2010-12-15 18:48:39",
+ "2010-12-15 19:25:00",
+ "2010
Dennis,
Thank you; this helps me, too!
Tom
On 12/19/10 11:45 AM, Dennis Murphy wrote:
Hi Dieter:
If I read your intention correctly, you need a third element in layout = .
Here's a little example:
df<- data.frame(month = rep(month.abb, each = 20),
time = rep(1:20, 12),
On Dec 19, 2010, at 11:23 AM, Dieter Menne wrote:
Dear latticists,
I would like to spread a lattice conditioned plot over multiple pages,
keeping the same layout as if I had only one page as shown in the code
below.
My workaround is to divide the dataframe into subset that fit on one
page,
Hi Dieter:
If I read your intention correctly, you need a third element in layout = .
Here's a little example:
df <- data.frame(month = rep(month.abb, each = 20),
time = rep(1:20, 12),
y = rnorm(240))
xyplot(y ~ time | month, data = df, layout = c(2, 2, 3))
Th
Dear latticists,
I would like to spread a lattice conditioned plot over multiple pages,
keeping the same layout as if I had only one page as shown in the code
below.
My workaround is to divide the dataframe into subset that fit on one page,
but the code is ugly.
Is there a build-in way to achi
On Dec 19, 2010, at 10:55 AM, Peter Ehlers wrote:
On 2010-12-19 07:13, fransiepansiekevertje wrote:
Hello,
I try to make barplots with rather wide labels. A simplified
example of
this:
x<- c(12, 33, 56, 67, 15, 66)
names(x)<- c('Richard with a long surname','Minnie with a long
name,'Albert
On 2010-12-19 07:13, fransiepansiekevertje wrote:
Hello,
I try to make barplots with rather wide labels. A simplified example of
this:
x<- c(12, 33, 56, 67, 15, 66)
names(x)<- c('Richard with a long surname','Minnie with a long
name,'Albert','Helen','Joe','Kingston')
barplot(x, las = 2)
Now the
Hello,
I try to make barplots with rather wide labels. A simplified example of
this:
x <- c(12, 33, 56, 67, 15, 66)
names(x) <- c('Richard with a long surname','Minnie with a long
name,'Albert','Helen','Joe','Kingston')
barplot(x, las = 2)
Now the label 'Richard with a long surname' is too long t
On Dec 19, 2010, at 8:08 AM, Torch wrote:
Hi,
is there a function that replaces the following code?
n=200
boot.x[1]=odhad+boot.res[1] #(boot.x[0]=1)
No. there is no boot.x[0] ... in R anyway.
for (j in 1:(n-1)) {
boot.x[j+1]=odhad*boot.x[j]+boot.res[j+1]
}
This is nested
Hi,
Forget, the chron package work with this
Thanks
Ronaldo
--
8ª lei - Colete seus dados hoje como se você soubesse que seu equipamento
vai quebrar amanhã.
--Herman, I. P. 2007. Following the law. NATURE, Vol 445, p. 228.
> Prof. Ronaldo Reis Júnior
| .''`. UNIMONTES/DBG/L
Hi,
I have this vector:
> A <- c("00:00:36","00:02:18")
> A
[1] "00:00:36" "00:02:18"
I use as.difftime to convert this to time vector based
> B <- as.difftime(A)
> B
Time differences in secs
[1] 36 138
attr(,"tzone")
[1] ""
Now i try to make a sum
> sum(B)
Time difference of 174 secs
On 2010-12-19 03:50, Luca Meyer wrote:
I am just wondering why what I am showing below might occur.
First I have an x data.frame:
str(x)
'data.frame': 281 obs. of 2 variables:
$ x1 : Factor w/ 5 levels "A (50-67%)","B (10-20%)",..: 1 2 5 1 2 5 1 2 5 1
...
$ x2 : num 33.8 60.2 6 7
Hi,
is there a function that replaces the following code?
n=200
boot.x[1]=odhad+boot.res[1] #(boot.x[0]=1)
for (j in 1:(n-1)) {
boot.x[j+1]=odhad*boot.x[j]+boot.res[j+1]
}
This is nested in two other loops, and I am looking for some way to improve
code performance
I tried sap
> Date: Sun, 19 Dec 2010 01:34:28 -0500
> From: mailinglist.honey...@gmail.com
> To: cjul...@bu.edu
> CC: r-help@r-project.org
> Subject: Re: [R] Resource for learning C/R interface
>
> Hi,
>
> On Sat, Dec 18, 2010 at 11:29 PM, Julian TszKin Chan wro
On Dec 19, 2010, at 5:31 AM, Tom Wilding wrote:
Dear Mailing List
I have a data set (data4) consisting of a number of factors and a
response variable. I wish to randomly sample from a combination of
two of those factors (GIS_station and Distance_code2) and return a
new dataframe contain
On Dec 19, 2010, at 5:11 AM, Luca Meyer wrote:
Something goes wrong with the week function of the lubridate package:
x= as.POSIXct(factor(c("2010-12-15 17:28:27",
+ "2010-12-15 17:32:34",
+ "2010-12-15 18:48:39",
+ "2010-12-15 19:25:00",
+ "2010-12-16 08:00:00",
+ "2010-1
I am just wondering why what I am showing below might occur.
First I have an x data.frame:
> str(x)
'data.frame': 281 obs. of 2 variables:
$ x1 : Factor w/ 5 levels "A (50-67%)","B (10-20%)",..: 1 2 5 1 2 5 1 2 5 1
...
$ x2 : num 33.8 60.2 6 76.8 13.8 9.4 76.9 8 15.1 78.1 ...
I need t
Dear Mailing List
I have a data set (data4) consisting of a number of factors and a response
variable. I wish to randomly sample from a combination of two of those factors
(GIS_station and Distance_code2) and return a new dataframe containing the
original data structure (i.e. all the columns)
Something goes wrong with the week function of the lubridate package:
> x= as.POSIXct(factor(c("2010-12-15 17:28:27",
+ "2010-12-15 17:32:34",
+ "2010-12-15 18:48:39",
+ "2010-12-15 19:25:00",
+ "2010-12-16 08:00:00",
+ "2010-12-16 08:25:49",
+ "2010-12-16 09:00:00")))
> re
On 18/12/2010 8:34 AM, Luca Meyer wrote:
I am running this small program:
x<- factor(c("A","B","A","C"))
y<- c(1,2,3,4)
w<-data.frame(x,y)
if (w$x=="A"){
w$z=1
}
w
And I obtain:
x y z
1 A 1 1
2 B 2 1
3 A 3 1
4 C 4 1
And not
x y z
1 A 1 1
2 B 2 NA
3 A 3 1
4 C 4 NA
Like I should
On 19/12/2010 3:00 AM, elprama wrote:
Dear R-users,
When you perform "run line or selection" / "Ctrl + R" in a script window
then the cursor of the script window does not go to the next line but at a
place further downwards.
R windows version 11 does the correct job (= goes to the next line) bu
I am running this small program:
x <- factor(c("A","B","A","C"))
y <- c(1,2,3,4)
w <-data.frame(x,y)
if (w$x=="A"){
w$z=1
}
w
And I obtain:
x y z
1 A 1 1
2 B 2 1
3 A 3 1
4 C 4 1
And not
x y z
1 A 1 1
2 B 2 NA
3 A 3 1
4 C 4 NA
Like I should obtain. What am I doing wrong?
Please not
Dear R-users,
When you perform "run line or selection" / "Ctrl + R" in a script window
then the cursor of the script window does not go to the next line but at a
place further downwards.
R windows version 11 does the correct job (= goes to the next line) but
version 12 does not.
Is this correct ?
On 12/17/2010 10:41 PM, phils_mu...@arcor.de wrote:
Hi,
I want to have a title for the y-axis on the right side of the plot.
I know how to do it on the left side:
title(ylab="Title for y-axis")
But how can I have the title on the right side?
Hi Phil,
You probably want to add some margin on
56 matches
Mail list logo