Hi Amelia,
You statement...
dbGetPreparedQuery(con, "INSERT INTO output(df) VALUES (?)", data.frame(output))
...is the problem.
To insert an entire data.frame into the database use dbWriteTable.
To insert with debSendPreparedQuery or dbGetPreparedQuery, the number
of "?" in the VALUES specifie
Hi,
Sorry to bother all, but recently I found an interesting application
of Rweb (although there are many other fancier web applications of R).
We can submit some simple code to Rweb to create an HTML page
containing animations. Most of Rweb servers I can find are still using
very old versions of
On Jan 15, 2011, at 5:37 PM, David Winsemius wrote:
On Jan 15, 2011, at 4:06 PM, Jonathan Flowers wrote:
Hi all,
I would like to iterate through a list with named elements and
access the
names within an lapply / sapply call. One way to do this is iterate
through
the names and index the
On Jan 15, 2011, at 4:06 PM, Jonathan Flowers wrote:
Hi all,
I would like to iterate through a list with named elements and
access the
names within an lapply / sapply call. One way to do this is iterate
through
the names and index the list with the name. Is there a way to iterate
through
On Sat, 15 Jan 2011, Dirk Eddelbuettel wrote:
On 15 January 2011 at 11:29, Carl Witthoft wrote:
|
| Somehow this reminds me of a famous FORTRAN code snippet:
|
| 10 STOP
| STOP
| STOP
| ! IN CASE STILL SKIDDING
| GOTO 10
Immediate candidate for the fortunes package!
Thx, added on R-Forge.
Z
Thanks Gene. I'll look into the Browse option.
Best,
Jonathan
On Sat, Jan 15, 2011 at 4:36 PM, Gene Leynes
> wrote:
> I one tried to write a function to do that, but it wasn't worth it / didn't
> work
>
> I found this to be a better solution:
> mynames = names(sapply(mylist, names))
> for(nm
I one tried to write a function to do that, but it wasn't worth it / didn't
work
I found this to be a better solution:
mynames = names(sapply(mylist, names))
for(nm in mynames){
print(mylist[nm])
# or "do other stuff"
}
You can use "browser" to look inside sapply, and the objects availabl
Regarding the issue of "inserting a newline during debugging":
If I remember correctly, this issue didn't happen in older versions of R.
and it seems connected to some other issues.
There generally seems to be something different with how the R Console is
being rendered, and it doesn't seem to be
Hi all,
I would like to iterate through a list with named elements and access the
names within an lapply / sapply call. One way to do this is iterate through
the names and index the list with the name. Is there a way to iterate
through the list elements themselves and access the element names wit
exp(median(log(x)) ?
Hadley
On Sat, Jan 15, 2011 at 10:26 AM, Skull Crossbones
wrote:
> Hi All,
>
> I need to calculate the median for even number of data points.However
> instead of calculating
> the arithmetic mean of the two middle values,I need to calculate their
> geometric mean.
>
> Though
Hi,
Does anyone know how I can specify the colors based on the data values in
heatmap?
I have values ranging from -4 to 25 and I want to specify colors as:
-4 = white
0 = white/snow
10 =darkblue
20 = red
25 = dark red
the command line that I am currently using is (which is close to what I want
Hi All,
I need to calculate the median for even number of data points.However
instead of calculating
the arithmetic mean of the two middle values,I need to calculate their
geometric mean.
Though I can code this in R, possibly in a few lines, but wondering if there
is
already some built in functio
On 15.01.2011 18:17, Ista Zahn wrote:
Hi Carl,
If you wrap the whole script in brackets the script will not proceed
past the stop() function:
{
for(i in 1:10){
print(i)
if(i == 5) stop("i == 5")
}
for(i in 11:100) print(i)
}
Yes, or write it inside a function (since I ass
Marius -
Do you get the behaviour you want if you substitute
if(i == 5){cat('i==5\n');quit(save='n')}
for the line with the call to stop?
- Phil Spector
Statistical Computing Facility
Hi Carl,
If you wrap the whole script in brackets the script will not proceed
past the stop() function:
{
for(i in 1:10){
print(i)
if(i == 5) stop("i == 5")
}
for(i in 11:100) print(i)
}
best,
Ista
On Sat, Jan 15, 2011 at 4:29 PM, Carl Witthoft wrote:
>
> Somehow this reminds m
On 15 January 2011 at 11:29, Carl Witthoft wrote:
|
| Somehow this reminds me of a famous FORTRAN code snippet:
|
| 10 STOP
| STOP
| STOP
| ! IN CASE STILL SKIDDING
| GOTO 10
Immediate candidate for the fortunes package!
Dirk
|
| From: Marius Hofert
| Date: Sat, 15 Jan 2011 09:09:20 +010
> Date: Sat, 15 Jan 2011 11:29:20 -0500
> From: c...@witthoft.com
> To: r-help@r-project.org
> Subject: [R] How to *completely* stop a script after stop()?
>
>
> Somehow this reminds me of a famous FORTRAN code snippet:
>
> 10 STOP
> STOP
> STOP
>
Somehow this reminds me of a famous FORTRAN code snippet:
10 STOP
STOP
STOP
! IN CASE STILL SKIDDING
GOTO 10
From: Marius Hofert
Date: Sat, 15 Jan 2011 09:09:20 +0100
Dear expeRts,
is there a neat way to *completely* stop a script after an error
occured? For example, consider the follow
Dear Göran
I too have been working on this for the last couple of weeks and this is a
great help thanks. I wonder can you advise on how the covariance matrix of
estimated parameters in phreg relates to those estimated in survreg.
Im hoping you can just put your finger on this. Your eha package
On Sat, 15 Jan 2011, vito.muggeo wrote:
dear all,
The package segmented allows to estimate piecewise linear relationships
(*connected*
lines, i.e. a gradual change in the slope) with several breakpoints (known or
unknown)
within (generalized) linear models..
The package also includes some func
On Jan 15, 2011, at 9:42 AM, analys...@hotmail.com wrote:
I have a function called plotID(ID) that would generate a plot for
customerID = "ID". I can run it repeatedly from within R without any
problems.
Would it be possible to run this function from the O/S command prompt;
each time you ente
On Jan 15, 2011, at 6:57 AM, Christine SINOQUET wrote:
Hello,
I really wonder how to distinguish between secs and mins in the
example below.
In other terms, how can I access the time unit in variable d ?
start1 <- Sys.time();
stop1 <- Sys.time(); d <- stop1-start1;
> str(d)
Class 'difft
I have a function called plotID(ID) that would generate a plot for
customerID = "ID". I can run it repeatedly from within R without any
problems.
Would it be possible to run this function from the O/S command prompt;
each time you enter an ID , it would open a graphics window with the
plot for th
On 15.01.2011 12:57, Christine SINOQUET wrote:
Hello,
I really wonder how to distinguish between secs and mins in the example
below.
In other terms, how can I access the time unit in variable d ?
start1 <- Sys.time();
stop1 <- Sys.time(); d <- stop1-start1; print(d);
v<-unlist(strsplit(as.ch
William Dunlap tibco.com> writes:
>
> But it fails on this:
> > my_names <- c("Bill", "William")
> > display(rev(my_names))
> rev(my_names) = Error in cat(list(...), file, sep, fill, labels,
> append) :
> argument 3 (type 'list') cannot be handled by 'cat'
> This is because you call ev
Thank u Doctor Muggeo,
I was just getting familiar with your package this morning..i find it
interesting 'cause so far is the only one that allows estimations for the
single slope parameters between brakepoints, by the slope() function.
Contrarily, supposing only one knot in a linear regression,I d
Hello,
I really wonder how to distinguish between secs and mins in the example
below.
In other terms, how can I access the time unit in variable d ?
start1 <- Sys.time();
stop1 <- Sys.time(); d <- stop1-start1; print(d);
v<-unlist(strsplit(as.character(d), split=" ")); print(v)
Time differe
Dear all,
I have used R.rps to produce a Google API chart (googleVis) with a
data request in another server.
But i don't understand how is possible to scheduling a request data
to the server and after produce a update of the charts.
Thanks in advance.
Alessandro Oggioni
___
On Fri, Jan 14, 2011 at 11:16 PM, Phil Spector
wrote:
> Is sapply really necessary here?
Apparently not, and it is certainly more cumbersome. Because data
frames can contain a mix of classes, I thought that round() did not
have a method for them (in retrospect that does not make much sense).
I h
Bill, Joshua, Phil
Thanks for the suggestions. Very much appreciated.
Kind regards
Pete
--
View this message in context:
http://r.789695.n4.nabble.com/Rounding-variables-in-a-data-frame-tp3218729p3219060.html
Sent from the R help mailing list archive at Nabble.com.
_
Does anyone know offhand if the OTS has an FTP site or other pages
off in a corner somewhere to make data downloading and integration with
R easy? They have mailing lists to which you can subscribe that announce new
data but then you get these things like PDF files
with tables of numbers and the P
Dear David,
scatterplot() isn't intended to produce parallel boxplots with a factor on
the RHS of the formula (though that's a reasonable feature request) but
rather, as the name implies, to make scatterplots. For boxplots with
labelled outliers, use the car function Boxplot(), as in Boxplot(incom
R2wd is working but i received an alarm:
> wdtxtStart()
Error en R2wd::wdGet() : tentativa de aplicar una no-función
The translation is "attempt to apply a no-function"
-
Mario Garrido Escudero
PhD student
Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca.
Agrícola
Univ
I take you don't use source() to execute your scripts. When using source,
stop() aborts the complete script, just as you indent to.
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-completely-stop-a-script-after-stop-tp3218808p3218823.html
Sent from the R help mailing list
Thanks so much for your help everyone, got it sorted now :)
this is what I used in the end:
timeofonlyfirstresponseafterrft<-testdata$Time[test<-which(!diff(as.numeric(factor(Stat,
levels = c("MagDwn", "Resp")]
timeofonlyfirstresponseafterrft1<-as.POSIXct(timeofonlyfirstresponseafterrft,
ori
Deal all,
I want to know if truetype or opentype fonts are available in pdf
device (i.e., pdf() or dev.copy2pdf()), and if so, how to do it?
Now I can do as followings:
1. convert ttf to afm using ttf2afm, e.g.: $ ttf2afm Impact.ttf > Impact.afm
2. put the afm file in $R_HOME/library/grDevices/a
Thank you all for the precious help.
Finally i could start the writing of a first part of my script, but now i
have a new question for you.
Need i to repeat the write.table portion for all the 15 lines or can i use a
"short cut"?
Example:
file.open <- "C:\\test.txt"
file.save <- "C:\\results.t
I am getting an error message from scatterplot:
> library(car)
> scatterplot(Prestige$income~Prestige$type)
Error in Summary.factor(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, :
range not meaningful for factors
In addition: Warning message:
In Ops.factor(x[floor(d)], x[ceiling(d)]) : + not m
When I import a data file in stata format using read.dta, the full variable
labels (e.g. variable= "inc2000"; variable label= "Total household income in
year 2000"). When I then export the same data file using write.dta, the
variable labels are not included in the new .dta file. Is there any way to
David,
Thanks. When I am back at work I will try to find out some specifics
regarding the original data base and how the reports are generated. The
differencs are not apparent via manual inspection.
I will look at the csv file in an editor as well and look into xlsReadWrite.
I agree EXCEL format
Dear expeRts,
is there a neat way to *completely* stop a script after an error occured?
For example, consider the following script:
## file.R
for(i in 1:10){
print(i)
if(i == 5) stop("i == 5")
}
for(i in 11:100) print(i)
##
stop() behaves like it shou
41 matches
Mail list logo