Hello together,
i have a problem with an export.
I want to export a data.frame, only if there ist data in it.
My data.frame (CO.PHB) ist empty but with this code, the .txt-file gets
exported every time, with no content.
{
pfad-paste(paste(paste(C:/Test/,Reminder,sep=),
Orders,sep=/),txt,sep=.)
Hi
I am not sure if it suits your needs but I use this function for identifying
peaks in different spectral data.
peaks - function (series, span = 3, ties.method = first)
{
if ((span - as.integer(span))%%2 != 1)
stop('span' must be odd)
z - embed(series, span)
s - span%/%2
Hi
You must use indexing based on loops
sim(ss[i],cc[j],oo1[k],oo2[l])
an of course assign result to some object.
result[...] - sim(ss[i],cc[j],oo1[k],oo2[l])
where ... means some suitable index either chosen from loop index or
constructed during loop execution.
Maybe it is time to go through
Hello,
There is also that previous discussion:
http://r.789695.n4.nabble.com/peak-detection-td3086410.html
Pascal
Le 07/02/2013 03:22, Johannes Graumann a écrit :
Grrr ... new trial with code here: http://pastebin.com/RjHNNG9J
Maybe the amount of inline-code prevented posting?
Hello,
I am
Readers,
For a 12 hour time stamp:
testtime-(2013-01-01 01:00:01 PM)
testtime
[1] 2013-01-01 01:00:01 PM
testtime24hour-strftime(testtime,'%H:%M:%S')
testtime24hour
[1] 01:00:01
how to convert to 24 hour format so that the object 'testtime24hour' is:
'13:00:01'
Thanks.
--
r2151
Hello,
I don't know whether it matches what you are looking for. Here are some
example using different spacing:
par(las=1, mfrow=c(2,2))
plot(1,1,ylab=expression(paste('rate (',degree~C^-1,')')),
main='Spacing with ~')
plot(1,1,ylab=expression(paste('rate (',degree,phantom(0),C^-1,')')),
Hello,
Try this:
testtime-(2013-01-01 01:00:01 PM)
strptime(testtime, %Y-%m-%d %I:%M:%S %p)
[1] 2013-01-01 13:00:01
HTH,
Pascal
Le 08/02/2013 18:44, e-letter a écrit :
Readers,
For a 12 hour time stamp:
testtime-(2013-01-01 01:00:01 PM)
testtime
[1] 2013-01-01 01:00:01 PM
Readers,
Is it possible to add a data symbol (e.g. pch='21') to an axis label?
The objective is to plot a graph with two (2) y-axes and the plotting
character for data set 1 is added to the label of y1 axis (left); plot
character for data set 2 is added to label of y2 (right) axis.
Thanks.
--
New versions 2.4 of our distr-family of packages are submitted to
CRAN and will soon be available on all mirrors
(i.e.; startupmsg, SweaveListingUtils, distr, distrEx, distrDoc,
distrEllipse, distrMod, distrSim, distrTEst, distrTeach)
In addition, there is a new package distrRmetrics with distr
hello,
I was having some problems in debugging C codes assocaited with R-packages.
I don't have much experience with debugging tools used in C language. Is
there any methods similar to R-debugging tools such as browser ,debug etc
which can be used to debug such C files.
I was using the foreign
Hi
Does not work in some locale environment
strptime(testtime, %Y-%m-%d %I:%M:%S %p)
[1] NA
Sys.getlocale(LC_TIME)
[1] Czech_Czech Republic.1250
Sys.setlocale(LC_TIME, C)
[1] C
strptime(testtime, %Y-%m-%d %I:%M:%S %p)
[1] 2013-01-01 13:00:01
Regards
Petr
-Original Message-
Dear list members,
I can't figure out how get 'xyplot' or 'dotplot' in the 'lattice'
package to respect the 'lwd' value for specifying the border with for
*symbols* (for lines it works fine). Example:
-
# Base graphics works fine (gives a 'fat’ circle)
plot(5, cex=10, pch=21, lwd=10)
#
You can do this directly with the survfit function (survival verstion 2.37 or
greater)
If status is a factor variable with levels of censored, relapse and death
fit - survfit(Surv(time, status) ~ sex, data=mydata)
plot(fit, xlab=...
The primary advantage of this over the cuminc package
Hi,
On Feb 8, 2013, at 2:49 AM, Mat wrote:
Hello together,
i have a problem with an export.
I want to export a data.frame, only if there ist data in it.
My data.frame (CO.PHB) ist empty but with this code, the .txt-file gets
exported every time, with no content.
{
Dear Elisha,
It's impossible to tell from the information that you provide what the
source of the problem is. The gold standard for a problem report is
commented, minimal, self-contained, reproducible code (quoting from the
text at the bottom of all r-help postings) that would allow me to track
Dear Janesh,
Re:
Dear Franklin Bretschneider,
Thank you so much for your reply and explanation about the filter using the
stats and signal package.
I decided to opt the filter method in signal package. I have a simple
question about the cut off frequency here.
I have 30 minute
Hi,
I am trying to append tables on file with this sample code:
for(i in 1:2){
mat - data.frame(sample(1:30,9),3,3)
colnames(mat) - letters[1:3]
ifelse(i ==
1,write.table(mat,paste('test.txt',sep=''),row.names=F),
I believe your problem stems from using ifelse() actually ... it
requires the statements which it runs to return a value with the same
shape as the test, which write.table() isn't doing.
Just change it to a regular if with an else and you'll be fine:
for(i in 1:2){
mat -
Thanks Louis! That seems to work!
On Fri, Feb 8, 2013 at 10:06 AM, Louis Aslett lasl...@louisaslett.comwrote:
I believe your problem stems from using ifelse() actually ... it
requires the statements which it runs to return a value with the same
shape as the test, which write.table() isn't
Hi,
On Feb 8, 2013, at 9:40 AM, Brian Smith wrote:
Hi,
I am trying to append tables on file with this sample code:
for(i in 1:2){
mat - data.frame(sample(1:30,9),3,3)
colnames(mat) - letters[1:3]
ifelse(i ==
I want to make a script in R (I use RStudio if it matters) in which the user
chooses the initial data file interactively using tk_choose.files
the code goes like this:
fname1-tk_choose.files(default = , caption = Choose file,multi = FALSE,
filters = NULL, index = 1)
however, it pops out new
Thanks, fixed upstream.
David
On 2013-02-08 07:20, Achim Zeileis wrote:
On Fri, 8 Feb 2013, Richard M. Heiberger wrote:
require(vcd)
mosaic(matrix(1:6, 2, 3), gp=gpar(fill=c(red,gray,blue)),
main=three
colors in each row)
mosaic(matrix(1:3, 1, 3), gp=gpar(fill=c(red,gray,blue)),
main=only
Hi,
library(lubridate)
ymd_hms(testtime)
1 parsed with %Y-%m-%d %I:%M:%S %p
#[1] 2013-01-01 13:00:01 UTC
A.K.
- Original Message -
From: e-letter inp...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Friday, February 8, 2013 4:44 AM
Subject: [R] convert 12 time stamp to 24 hour
Ah, I didn't know this! Thanks Ben.
On Fri, Feb 8, 2013 at 10:18 AM, Ben Tupper btup...@bigelow.org wrote:
Hi,
On Feb 8, 2013, at 9:40 AM, Brian Smith wrote:
Hi,
I am trying to append tables on file with this sample code:
for(i in 1:2){
mat -
On Thu, Feb 7, 2013 at 9:58 PM, James Jong ribonucle...@gmail.com wrote:
What are the *RDS counterparts? What is the difference?
apropos(RDS)
? readRDS
? saveRDS
They allow serialization of an individual object and restoring it --
the advantage is that you can restore to a different name
hi there,
I have a dataframe in the shape vA1, vA2,..., vA11, vB1, vB2,..., VB11,...,
VP1, VP2,, VP11 (so 16 times a sequence of 11 variables)
I am trying to build a double loop so that i can apply the function (i-1)*v(i)
to the first 10 variables, then the same for the next 10
On Feb 7, 2013, at 8:20 AM, Giuseppe Amatulli wrote:
Hi Rolf,
sorry for this late answer and thanks for your kind explanation and
relative R code. I really appreciate.
In reality the concept that I'm trying to address is a bit more complex.
I'm fitting a model y vs 6 predictors with MARS /
I seem to have a Friday afternoon block and can't see the easiest way of
doing this.
Given a data frame like:
dat - data.frame(x = runif(100), y = runif(100), group = rep(letters[1:10],
each = 10))
head(dat)
x y group
1 0.876751503 0.6518345 a
2 0.627067150 0.8801790
On Feb 8, 2013, at 3:53 AM, e-letter wrote:
Readers,
Is it possible to add a data symbol (e.g. pch='21') to an axis label?
The objective is to plot a graph with two (2) y-axes and the plotting
character for data set 1 is added to the label of y1 axis (left); plot
character for data set 2
On Feb 8, 2013, at 5:13 AM, Pulkit Mehrotra wrote:
hello,
I was having some problems in debugging C codes assocaited with R-packages.
I don't have much experience with debugging tools used in C language. Is
there any methods similar to R-debugging tools such as browser ,debug etc
which
Hello,
Maybe seq(1, 16*11, 11)? (16*11 is 176, not 166)
Hope this helps,
Rui Barradas
Em 08-02-2013 16:03, christel lacaze escreveu:
hi there,
I have a dataframe in the shape vA1, vA2,..., vA11, vB1, vB2,..., VB11,...,
VP1, VP2,, VP11 (so 16 times a sequence of 11 variables)
I am
Like this ?
xyplot(4:5~4:5, groups=4:5, lex = 5 ,
par.settings = simpleTheme(cex=10, pch=21, lwd=5),
auto.key=TRUE)
On Fri, Feb 8, 2013 at 6:46 AM, Karl Ove Hufthammer k...@huftis.org wrote:
Dear list members,
I can't figure out how get 'xyplot' or 'dotplot' in the 'lattice' package
to
On Feb 8, 2013, at 5:46 AM, Karl Ove Hufthammer wrote:
Dear list members,
I can't figure out how get 'xyplot' or 'dotplot' in the 'lattice' package to
respect the 'lwd' value for specifying the border with for *symbols* (for
lines it works fine). Example:
-
# Base graphics works
that doesn't seem to be the issue i'm afraid... both j sequences produce the
same numbers:
j-seq(1,166,11)
j
[1] 1 12 23 34 45 56 67 78 89 100 111 122 133 144 155 166
j-seq(1,176,11)
j
[1] 1 12 23 34 45 56 67 78 89 100 111 122 133 144 155 166
Date: Fri, 8 Feb 2013
On Feb 8, 2013, at 8:55 AM, ilai wrote:
Like this ?
xyplot(4:5~4:5, groups=4:5, lex = 5 ,
par.settings = simpleTheme(cex=10, pch=21, lwd=5),
auto.key=TRUE)
And if I had used a more general search strategy I might have found it, too,
rather than hacking my way to a less adequate solution;
On Fri, Feb 8, 2013 at 10:14 AM, David Winsemius dwinsem...@comcast.netwrote:
On Feb 8, 2013, at 8:55 AM, ilai wrote:
Like this ?
xyplot(4:5~4:5, groups=4:5, lex = 5 ,
par.settings = simpleTheme(cex=10, pch=21, lwd=5),
auto.key=TRUE)
And if I had used a more general search strategy
useRs,
Using a code suggestion from the previous post in this thread (quoted
next), I was able to work through a smaller example problem and get some
results I was aiming for.
That might not construct the bands in the blocks correctly: This might
be better:
MAT [ kronecker( matrix(1, 4,4), abs(
On 02/08/2013 05:13 AM, Pulkit Mehrotra wrote:
hello,
I was having some problems in debugging C codes assocaited with R-packages.
I don't have much experience with debugging tools used in C language. Is
there any methods similar to R-debugging tools such as browser ,debug etc
which can be used
I seem to be suffering from the same problem (the Friday one, not the cor one)
Have a look at
http://stats.stackexchange.com/questions/4040/r-compute-correlation-by-group
for something that looks like it will work
John Kane
Kingston ON Canada
-Original Message-
From:
I wanted to put a short example into the r-help archives how to embed
the Bera (texlive) font.
options(texlive= /usr/local/texlive/2012/)
options(texfonts= paste0(getOption(texlive), /texmf-dist/fonts/))
library(grDevices)
pdfFonts(Bera = Type1Font(Bera, paste0(getOption(texfonts),
I realize it's -12C and we're having the next best thing to a blizzard but why
can I not melt this data frame.
I am missing something terribly obvious but I just don't understand what the
error message is saying.
John Kane
Kingston ON Canada
Code and aata below
Just posting to answer my own question, at least for the variables
constant error: I hadn't noticed that lda has an argument called 'tol'
that governs when variables are interpreted as constant within groups; it's
right there in the help entry for lda, so I apologize for having missed
it.As
Dear Tom,
As you can imagine, I watched your video with interest and found it quite
impressive. I do have a couple of comments and a question.
The comments: You change a numeric ID variable into a factor with several
thousand levels. I think that it would be more natural and efficient to
assign
On 02/07/2013 05:00 AM, r-help-requ...@r-project.org wrote:
I'd argue that there's an important distinction between documenting a
function (how to use it) vs. documenting an algorithm (how it works).
I think noweb can work well for describing how something works, but
it's not so good for
Hi everyone,
I'm not exactly sure how to ask this question most clearly, but I hope that
giving the context in which it occurs for me will help: I'm trying to
compare the brain images of two patient populations; each image is composed
of voxels (the 3D analogue of pixels), and I have two images
Hello,
The id.vars must be integer (variable position) or string (variable
name) (from the help page ?melt.data.frame)
This seems to work.
myd - mydata
myd$date - as.character(myd$date)
melt(myd, id.vars = c(date))
Hope this helps,
Rui Barradas
Em 08-02-2013 18:31, John Kane escreveu:
I
Dear list,
Is there a elegant way to name multiple ordered plot as A, B, C and D?
Just put A, B, C and D on the top left corner of each plot.
Usually I do it in Illustrator, but I think in R should there is a way.
Could you please provide a example?
Thank you very much in advance.
Use POSIXct instead of POSIXlt in data frames in general, and particularly for
this task.
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.
Yes there probably is if you would show us what you are doing.
Minimal working code helps.
https://github.com/hadley/devtools/wiki/Reproducibility
John Kane
Kingston ON Canada
-Original Message-
From: fabrice.c...@gmail.com
Sent: Fri, 8 Feb 2013 14:28:17 -0500
To:
Thank your reminder.
Here is the example code:
a- rnorm(1000,0,1)
b-rnorm(1000,0,2)
c-rnorm(1000,0,3)
d-rnorm(1000,0,4)
par(mfrow=c(2,2))
hist(a)
hist(b)
hist(c)
hist(d)
I want to add A, B, C and D on each top left.
On Fri, Feb 8, 2013 at 2:35 PM, John Kane jrkrid...@inbox.com wrote:
Yes there
Here is a rough example of what you want. You will need to adjust the actual
placement by hand by redefining the x y values.
set.seed(100)
a - rnorm(1000,0,1)
b -rnorm(1000,0,2)
c -rnorm(1000,0,3)
d -rnorm(1000,0,4)
opr - par(mfrow=c(2,2))
hist(a)
text(-3, 150, labels =a)
Try:
a- rnorm(1000,0,1)
b- rnorm(1000,0,2)
c- rnorm(1000,0,3)
d- rnorm(1000,0,4)
par(mfrow=c(2,2))
hist(a,main=)
title(main=A,adj=0)
hist(b,main=)
title(main=B,adj=0)
hist(c,main=)
title(main=C,adj=0)
hist(d,main=)
title(main=D,adj=0)
cheers,
Rolf Turner
On 02/09/2013 08:42 AM,
Hello,
You're right, sorry for the misleading tip. How about seq(1, 177, 11)?
Please note that without a data example, it's not very easy to say.
Can't you post a small dataset using ?dput
dput(head(data, 20)) # paste the output of this.
Rui Barradas
Em 08-02-2013 17:10, christel lacaze
Hello,
With the following, the first instruction will give you correlations
matrices, the second coefficients.
dat - read.table(text =
x y group
1 0.876751503 0.6518345 a
2 0.627067150 0.8801790 a
3 0.632465192 0.1768305 a
4 0.060359554 0.8835652 a
5
I know that I can get a count of histogram bins in base R with plot=FALSE.
However, I'd like to do the same thing with lattice. The problem is that I've
set up shingles, and I'd like to get the count within each bin within each
shingle. plot=FALSE doesn't seem to do it.
John Kane,
Thanks. It makes some of sense. But it seems not exactly what I want.
I just remember it need using mtext and adjust margin. I saw such of
example long time ago, but I have forgotten it.
On Fri, Feb 8, 2013 at 3:32 PM, John Kane jrkrid...@inbox.com wrote:
Here is a rough example of
Dear All,
I am trying to merge 2 dataframes of with different sizes.
Let's say that one dataframe R contains some raw data and another data
frame F contains the information to fix R.
For instance
F - data.frame(cbind(x=-seq(10),
y=1:10,
z=3:12,
Hi Tom,
I also teach R to newbies (materials at
http://projects.iq.harvard.edu/rtc/filter_by/r-0), and I've found
RStudio (http://rstudio.com/ide) a huge help, and much less
intimidating than the Windows GUI. File and object browsers,
integrated help window, syntax highlighting and code
On Feb 8, 2013, at 10:55 AM, Edwin Isensee wrote:
I'm using the read.xls function from gdata package to read one Excel file,
like the example below:
library(gdata)
my_file - '/Users/Desktop/Project.xlsx'
valores - read.xls(my_file)
The problem is: one of the columns at the Excel file
Hi,
Try:
R[,2:4]-F[,2:4][match(R$x,F$x),]
R$p- unique(F$p)
R
x y z w k p
1 -1 1 3 8 9 18
2 -2 2 4 9 9 18
3 -3 3 5 10 9 18
4 -1 1 3 8 9 18
5 -2 2 4 9 9 18
6 -3 3 5 10 9 18
7 -1 1 3 8 9 18
8 -2 2 4 9 9 18
9 -3 3 5 10 9 18
10 -1 1 3 8 9 18
11 -2 2 4 9 9 18
12 -3 3 5 10 9
David Winsemius dwinsemius at comcast.net writes:
On Feb 8, 2013, at 10:55 AM, Edwin Isensee wrote:
I'm using the read.xls function from gdata package to read one Excel file,
like the example below:
library(gdata)
my_file - '/Users/Desktop/Project.xlsx'
valores - read.xls(my_file)
Hi,
I am using a data called Rail in the nlme package. The data contains two
variables: Rail and Travel.
Rail
Grouped Data: travel ~ 1 | Rail
Rail travel
1 1 55
2 1 53
3 1 54
4 2 26
5 2 37
6 2 32
7 3 78
8 3 91
9 3 85
10
Rail is an ordered factor. ?ordered for details.
Default contrasts for an ordered factor are orthogonal polynomials.
See: https://stat.ethz.ch/pipermail/r-help/2007-January/123268.html
and
http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm#ORTHOGONAL
-- Bert
On Fri, Feb 8, 2013 at
Dear Fabrice Tourre,
Re:
John Kane,
Thanks. It makes some of sense. But it seems not exactly what I want.
I just remember it need using mtext and adjust margin. I saw such of
example long time ago, but I have forgotten it.
(etc...)
Maybe this is what you're after?
Fiddled a bit
dear R experts---I am trying to replicate a perl feature. I want to be
able to embed R commands inside a character string, and have the
string be printed with the command executed. my perl equivalent is
my $a=10;
my $teststring = the expression, $a+1, is ::$a+1::, but add one
more for
I do not promise much. But try to use XLConnect package. It requires rJava
package which requires java on your system.
Good luck
Orvalho
On Fri, Feb 8, 2013 at 8:55 PM, Edwin Isensee edwin.isen...@gmail.comwrote:
I'm using the read.xls function from gdata package to read one Excel file,
like
-- Forwarded message --
From: r-help-ow...@r-project.org
Date: 2013/2/8
Subject: vegdist Error en double(N * (N - 1)/2) : tama?o del vector
especificado es muy grande
To: caro.bell...@gmail.com
Message rejected by filter rule match
-- Mensaje reenviado --
From:
Greets,
My data looks like:
p3.18
s xbar subgroup
1 0.84 12.21
2 1.64 11.22
3 2.07 10.63
4 2.49 12.24
5 0.84 11.25
...
Using the command
qcc(p3.18$xbar,type=xbar,sizes=5,center=mean(p3.18$xbar),std.dev=mean(p3.18$s)/0.94,title=X-bar
Chart
Hi all, hope someone can help me out with this.
Background Introduction
I have a data set consisting of data collected from a questionnaire that I
wish to validate. I have chosen to use confirmatory factor analysis to
analyse this data set.
Instrument
The instrument consists of 11 subscales.
On 02/08/2013 10:53 PM, e-letter wrote:
Readers,
Is it possible to add a data symbol (e.g. pch='21') to an axis label?
The objective is to plot a graph with two (2) y-axes and the plotting
character for data set 1 is added to the label of y1 axis (left); plot
character for data set 2 is added
70 matches
Mail list logo