Hi,all:
I have a vector,and wanna get the opposite value via rev function.
> a
[1] FALSE FALSE TRUE TRUE TRUE
>
> rev(a)
[1] TRUE TRUE TRUE FALSE FALSE
>
I don't know why the 3rd "TRUE" has not been reversed,while all other values
are reversed?
Thanks
My best
[[alternati
Hello all
I'm new to R and am experiencing a problem with a categorical variable. All
the data of this variable are "Low", "High", or NA. When I put
summary(x$y), it gives me the number of High, Low, and NA entries. However,
when I try to subset by writing x$y=="Low" or x$y=="High", R does
I'm using the {lattice} "levelplot" function to make a (more or less) 2-d
histogram, and for the most part it's working fine with my data. However, I
can't get the color key to do what I need. I can give it labels and custom
cutoffs, but my cutoff lines (and hence my labels) aren't evenly spac
Hi,
I would like to attach my answer although this question has been posted here
for more than a year.
I believe some people may meet the same problem.
I use sampling package to do the stratified sampling as well, using strata()
function.
And everything goes well before I add another library: Hmis
I forgot to say I have commented out your function's first line,
sistring <- paste(x)
It wouldn't cause any problem, it's just not needed.
Rui Barradas
--
View this message in context:
http://r.789695.n4.nabble.com/automatic-SI-prefixes-as-ticklabels-on-axis-tp4266141p4267965.html
Sent from t
Hello,
You can use your function with 'lapply'
getSIstring(2e7)
getSIstring(2e-8)
lapply(c(2e7, 2e-8, 1234), getSIstring) # as a list
unlist(lapply(c(2e7, 2e-8, 1234), getSIstring)) # as a character vector
or you can include the 'lapply' in the function body
getSIstring2 <- function(
Em 5/1/2012 14:59, severine.fri...@lshtm.ac.uk escreveu:
Dear Gustaf,
I wish you a happy new year!
I am a PhD Staff at LSHTM and I have been trying to use WHO anthro
macros in R with the file you posted on internet but when I double
check the WHZ, HAZ, WAZ output with output from ENA or STATA,
Hi Jannis
[I'm the author of package debug... I know this is 6 months after your query,
sorry-- but I don't subscribe to R-help, and you didn't post to the maintainer!
I'm primarily sending this to close off the thread.]
> when I use the package debug, mark a function with mtrace() and enter
>
Hello,
I have both foreign and Hmisc packages installed. However, when I attempt to
import a SPSS .por file, I get the following error message:
Error in read.spss(file, use.value.labels = use.value.labels, to.data.frame =
to.data.frame, :
error reading portable-file dictionary
In addition:
On Thu, Jan 5, 2012 at 3:29 PM, Tom Roche wrote:
>
> How to programmatically (i.e., without no or minimal handcoding) copy
> a netCDF file? (Without calling
>
> > system("cp whatever wherever")
>
> [...]
>
> So I'm wondering, can anyone point me to, or provide, code that copies
> a netCDF file
On Jan 5, 2012, at 8:02 PM, Jonas Stein wrote:
> On 2012-01-05, Jonas Stein wrote:
>> i want to plot values with frequency on a logarithmic x axis.
>> similar to this example that i found in the web:
>> http://www.usspeaker.com/jensen%20p15n-graph.gif
>>
>> I would like to convert long numbers
On 2012-01-05, Jonas Stein wrote:
> i want to plot values with frequency on a logarithmic x axis.
> similar to this example that i found in the web:
> http://www.usspeaker.com/jensen%20p15n-graph.gif
>
> I would like to convert long numbers to si prefix notation
> like in the example
>
> (20
How to programmatically (i.e., without no or minimal handcoding) copy
a netCDF file? (Without calling
> system("cp whatever wherever")
:-) Why I ask:
I need to "do surgery" on a large netCDF file (technically an I/O API
file which uses netCDF). My group believes a data-assimilation error
caused
> As Duncan noted, the message is pretty clear in that the ODBC header files
> are missing, which are required to compile RODBC from source. On RH based
> Linuxen, this requires the installation of the unixODBC-devel RPM, much as
> one would need to have other *-devel RPMs (eg. readline-devel) i
On Jan 5, 2012, at 12:50 PM, correu griera wrote:
Helo:
After changing "involuntarily" some of the graphics parameters with
the command par() (I did not know that changes with this command are
permanent), now when I made a plot of the survival Kaplan-Meier
function, the Y axis does not start a
> I am not sure if you have found Rcpp yet
I will take a look for sure! Thanks a lot!
Ian
-Original Message-
From: Dirk Eddelbuettel [mailto:e...@debian.org]
Sent: 5 janvier 2012 15:18
To: Ian Schiller
Cc: r-help@r-project.org
Subject: Re: [R] Calling R functions within C/C++
On 5 Jan
On 5 January 2012 at 15:04, Ian Schiller wrote:
| Hello everyone!
|
| First of all, please note that I'm working under Windows 7.
|
| I have written a Gibbs sampler in R and I'm now in the process of translating
it in C++ to increase the speed. I'm relatively new to C++ and this question
may
Helo:
After changing "involuntarily" some of the graphics parameters with
the command par() (I did not know that changes with this command are
permanent), now when I made a plot of the survival Kaplan-Meier
function, the Y axis does not start at 1, and the X axis does starts
at 0. The commands tha
Dear Gustaf,
I wish you a happy new year!
I am a PhD Staff at LSHTM and I have been trying to use WHO anthro macros in R
with the file you posted on internet but when I double check the WHZ, HAZ, WAZ
output with output from ENA or STATA, it differs slightly. Do you have any idea
why that mig
Hello everyone!
First of all, please note that I'm working under Windows 7.
I have written a Gibbs sampler in R and I'm now in the process of translating
it in C++ to increase the speed. I'm relatively new to C++ and this question
may be trivial, but my search so far have been unsuccessful.
Thanks for the improvements. The main point in
my original post was that altering the arguments
of a function is a really bad thing to do in R
(except when using replacement functions). A
function that alters other objects in the caller's
environment is also really bad. By "bad" I mean
that such
On 01/05/2012 09:18 AM, Tom Roche wrote:
William Dunlap Wed, 4 Jan 2012 22:54:41 +
R functions [can] use their enclosing environments to save state.
Aha!
makeStack<- function () {
stack<- list()
list(pop = function() {
if (length(stack) == 0) { # get from an enclosing env.
On Thu, 5 Jan 2012, William Dunlap wrote:
Most plot methods die with an error like this if all the values in y (or
x) are NA. E.g., you get the same problem with
plot(rep(NA, 10))
Remove the columns that are all NA's before trying to plot them.
Bill,
Ah, so. I did not look to see if all
On 12-01-05 12:05 PM, Ana wrote:
I am looking for other option to write the output of the print command in R
You don't say why you want this or what platform you're working on, so
it's hard to choose among the many options, but one possibility is to
run your script using R CMD BATCH or Rscrip
On Jan 5, 2012, at 12:05 PM, Ana wrote:
I am looking for other option to write the output of the print
command in R
?capture.output
I am using sink() to write the R output to a file. This is similar to
what I have:
a=c(1:30)
a
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1
Most plot methods die with an error like this
if all the values in y (or x) are NA. E.g.,
you get the same problem with
plot(rep(NA, 10))
Remove the columns that are all NA's before trying to
plot them.
It might be nice if the fancier plot methods could
trap such errors and perhaps put some te
cat(file = )
M
On Thu, Jan 5, 2012 at 11:05 AM, Ana wrote:
> I am looking for other option to write the output of the print command in R
>
> I am using sink() to write the R output to a file. This is similar to
> what I have:
>
>> a=c(1:30)
>> a
> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1
William Dunlap Wed, 4 Jan 2012 22:54:41 +
> R functions [can] use their enclosing environments to save state.
Aha!
> makeStack <- function () {
> stack <- list()
> list(pop = function() {
> if (length(stack) == 0) { # get from an enclosing env.
> retval <- NULL
> } else {
>
The simulate function in dse lets you specify the model and the
distribution of the noise term (or even their values so you can get any
distribution you like). So, you should be able to do what you want,
with either a VAR(p) or a vector ARMA process. If you are getting a
process that explodes
On Thu, 5 Jan 2012, R. Michael Weylandt wrote:
My initial guess is because you don't have any complete cases: cf.
this behavior plot(c(NA, NA))
Michael,
I may be creating the plots incorrectly: using plot() rather than
plot.zoo(). When I compare the plot of the zoo object to a lattice xyplo
I am looking for other option to write the output of the print command in R
I am using sink() to write the R output to a file. This is similar to
what I have:
> a=c(1:30)
> a
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30
> sink("vectorA.txt");print
On Thu, 5 Jan 2012, R. Michael Weylandt wrote:
My initial guess is because you don't have any complete cases: cf.
this behavior plot(c(NA, NA))
Michael,
Here's a data frame that does plot; no complete cases here, either:
mahalla.tds.z
MAH-100 MAH-225 MAH-50 MASH-10 MASH-20 MASH-
how bout:
dat<-data.frame(id=1:4,city=c('berlin','munich'),likeability=c(5,4,6,5),uniqueness=c(3,4,4,4))
ggplot(ddply(melt(dat,
id.vars=c('id','city')),
.(variable,city),
summarise,
value=mean(value)),
aes(x
My initial guess is because you don't have any complete cases: cf.
this behavior plot(c(NA, NA))
If that's not it, dput() your data so that it's useable by others.
Michael
On Thu, Jan 5, 2012 at 10:43 AM, Rich Shepard wrote:
> Please provide a pointer to the source of this problem so I can und
Please provide a pointer to the source of this problem so I can understand
why it occurred.
The data frame is:
millc.tds.z
MC-0.5 MC-1 MC-2 MC-30 MC-50
1994-01-20 NA NA 429NANA
1994-03-24 NA NA 479NANA
1994-04-21 NA NA 456NANA
1994-05-1
Hi,
if you are not member of this list, you can not post.
That is fine so far.
This list is mirrored via Gmane as a nntp gateway.
It would be great if a new user could
subscribe this Mailinglist as gmane.comp.lang.r.general
On reply to his first posting he will get a verification mail
(same th
Hello, R friends,
I've been struggling quite a bit with ggplot2.
Having worked through Hadleys book twice I still wonder how to solve this task.
1. Short example Dataframe:
id city Likeability Uniqueness
1 Berlin 5 3
2 Munich 4 4
3 Berlin 6 4
4 Munich
i want to plot values with frequency on a logarithmic x axis.
similar to this example that i found in the web:
http://www.usspeaker.com/jensen%20p15n-graph.gif
I would like to convert long numbers to si prefix notation
like in the example
(20 to 200k, 3500 to 3.5 M)
Of course i could cr
see ?merge
> merge(xx,aa,by.x='x',by.y='a')
x y b
1 2.00112e+11 1.0 1.2
2 2.00112e+11 1.1 1.9
making the two matricies time series does not mean that R knows that the
first column is a datetime.
and depending on your desired result, that may not be important.
hope that helps,
Ju
On Jan 5, 2012, at 17:04 , Christof Kluß wrote:
> Hi
>
> the output should look like r <- subset(tab, a==v)
> but now I have something like r <- subset(tab, "a"==v)
> and r <- subset(tab, [["a"]]==v)
> does not work :(
Presumably something with eval, bquote and
On Jan 5, 2012, at 10:04 AM, Christof Kluß wrote:
> Hi
>
> the output should look like r <- subset(tab, a==v)
> but now I have something like r <- subset(tab, "a"==v)
> and r <- subset(tab, [["a"]]==v)
> does not work :(
>
> greetings
> Christof
>
> Am 05-01-20
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Christof Kluß
> Sent: Thursday, January 05, 2012 8:04 AM
> Cc: r-h...@stat.math.ethz.ch
> Subject: Re: [R] selection part of "subset"
>
> Hi
>
> the output should look like
Le jeudi 05 janvier 2012 à 16:51 +0100, Christof Kluß a écrit :
> Hi
>
> I want to do something like
>
> a <- c(10,20,15,43,76,41,25,46)
> tab <- data.frame(a)
>
> name <- "a"
>
> for (v in unique(tab[[name]])) {
> r <- subset(tab, name==v) # this does not work
> ...
> }
>
> i.e. a "stri
I don't know how to do it with subset, but this is equivalent for
your example:
tab[tab[[name]] == v,]
Also, you might want to look at ?"==" and ?identical.
Sarah
On Thu, Jan 5, 2012 at 11:04 AM, Christof Kluß wrote:
> Hi
>
> the output should look like r <- subset(tab, a==v)
> but now I h
Hi
the output should look like r <- subset(tab, a==v)
but now I have something like r <- subset(tab, "a"==v)
and r <- subset(tab, [["a"]]==v)
does not work :(
greetings
Christof
Am 05-01-2012 16:51, schrieb Christof Kluß:
> Hi
>
> I want to do something like
>
Lian:
I doubt whether anyone on this list would be willing to wade through
your code to track this down, although some smart folks may be able to
guess what the issue is (alas for you, I am not one of them!). So now
is as good a time as any to start learning about R's debugging tools.
First, you
Hi
I want to do something like
a <- c(10,20,15,43,76,41,25,46)
tab <- data.frame(a)
name <- "a"
for (v in unique(tab[[name]])) {
r <- subset(tab, name==v) # this does not work
...
}
i.e. a "string" on the left side of the select expression (subset). How
could I solve this?
thx
Christof
was trying to match different matrices of different lengths with in
the first collumn date and time info (yearmonthdayhourminute). the
routine needs to return NA´s where data of either of the matrices is
non existent.
have been trying the following:
x <- c(200112030003, 200112030004, 200112
Hi all!
I'm new to this forum so please excuse me if I don't conform perfectly to
the protocols on this board!
I'm trying to get an estimate of true prevalence based upon results from an
imperfect test. I have various estimates of se/sp which could inform my
priors (at least upper and lower limit
Christof Kluß email.uni-kiel.de> writes:
> Am 02-01-2012 10:54, schrieb ken knoblauch:
> > Christof Kluß email.uni-kiel.de> writes:
> >> lme<- lme(conc ~ name/time - 1,
> >> random=conc~time|nr,method="ML",data=measurements)
> > see plot.augPred in the nlme package
> thx, but how to set "primary
At 11:16 04/01/2012, XUT wrote:
I would like to make a meta analysis based on metafor package. If I only have
the data of RR, 95%CI of every study, could I finish the meta analysis?
Yes, of course. Any good book on meta-analysis should help you here,
Hint, how do you think the 95%CI was calcul
David Winsemius wrote
>
> The insight that
> allowed me to get a significantly higher frequency of success was
> realizing that the correct separators between separate expressions
> were "*" and "~" rather than or . Inside an expression
> a comma will signal a new expression element. A
On Jan 5, 2012, at 12:56 AM, Bert Gunter wrote:
David!
...
It means the author either doesn't know the 'sample' function, or
wants you
to understand how to use 'rbinom', or that's just the way she thinks.
Could someone help? Thanks so much,
X1<-c("A","B")[rbinom(n,1,0.6)+1]
X2<-c("C","
On Jan 5, 2012, at 02:10 , Yoo Jinho wrote:
> Dear all,
>
> I have found some difference of the results between multinom() function in
> R and multinomial logistic regression in SPSS software.
>
> The input data, model and parameters are below:
>
> choles <- c(94, 158, 133, 164, 162, 182, 140,
Hi Dr Terry,
Thank you for your reply.
Step(1) - Lets assume Generalized Poisson model (GLM) as basic model
where constant hazards ratio as time goes by. Below are two correlated GLM.
X_ij = Poisson( lambda_1 = \gamma * \alpha_i * \delta_j )
Y_ij = Poisson( lambda_2 =
Hi everyone,
I use this code to add the fitted line to a plot, however, I think I cannot
access the fitted equation. How my I find the equation in the object ksi?
thanks alot.
library (gss)
generate (simple linear) x and y
x= 2* (1:40)
y= x-1
plot (x,y)
## fit and draw
ksi = ssanova0 (x~y,
There is a crude implementation of
stacks in 'S Poetry' (available on
www.burns-stat.com). I haven't looked
at it, but I'd guess that code would
work in R as well.
On 04/01/2012 21:22, Tom Roche wrote:
summary: Specifically, how does one do stack/FIFO operations in R?
Generally, how does one c
57 matches
Mail list logo