Hi
or if Dan prefers data frame (which is also a list)
CInew2 <-function(x,alpha){
data.frame(variable = deparse(substitute(x)), mean=mean(x), alpha = alpha)
}
> CInew2(JOBSTAT, 0.05)
variable mean alpha
1 JOBSTAT 0.4567117 0.05
Regards
Petr
>
> In this case you want to use a 'list
uf_mike ufl.edu> writes:
>
> Hi, all! I'm new to R but need to use it to solve a little problem I'm having
> with a paper I'm writing. The question has a few components and I'd
> appreciate guidance on any of them.
>
> 1. The most essential thing is that I need to generate some multivariate
> n
Steven Bauer gmail.com> writes:
>
> As I am sitting here waiting for some R scripts to run...I was
> wondering... is there any way to parallelize rbind in R?
>
> I wait for this call to complete frequently as I deal with large
> amounts of data.
>
> do.call("rbind", LIST)
Perfectly reasonab
Hi
>
> Dear R-help readers,
>
> I'm sure this problem has been answered but I can't find the solution.
>
> I have two vectors
> v1 <- c("a","b")
> v2 <- c(1,2,3)
> I want an easy way to produce every possible combination of v1, v2
elements
> Ie I want to produce
> c("a1","a2","a3", "b1","b2","b
Hi all,
I have a 3x4 contingency table with row totals all being 100. I want to
generate 3 x 4 tables from the null distribution. Which R function can do
this?
--
Thanks,
Jim.
[[alternative HTML version deleted]]
__
R-help@r-project.org maili
Oops, I mixed up rbind and cbind. If LIST consists
of n numeric vectors, each of length p, try
matrix(unlilst(LIST, use.names=FALSE), nrow=n, byrow=TRUE)
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: William Dunlap
> Sent: Sunday, August 28, 2011
If you know much about what the elements of LIST look like
you can speed things up by not making R figure out what
you already know. E.g., if you know that LIST consists of
p numeric vectors, all of the same length, n, then the following
might be faster
matrix(unlist(LIST, use.names=FALSE), nro
Hi
If you change the NA to a value either below or above the range of
values you can then use it.
Below is something that is cobbled together from some code I have.
The datacols argument may be necessary if you want to do something
fancy like I was doing
I used my own colours to see if all w
What exactly do you mean by "parallelize"? What is wrong with the
approach that you are using now? What is a "large amount of data"?
Can you give some specifics on the problem you are trying to solve and
why your present approach does not appear to be working? What are
your expectations of a pot
As I am sitting here waiting for some R scripts to run...I was
wondering... is there any way to parallelize rbind in R?
I wait for this call to complete frequently as I deal with large
amounts of data.
do.call("rbind", LIST)
__
R-help@r-project.org mai
Hi, all! I'm new to R but need to use it to solve a little problem I'm having
with a paper I'm writing. The question has a few components and I'd
appreciate guidance on any of them.
1. The most essential thing is that I need to generate some multivariate
normal data on a restricted integer range (
Thanks a bunch, it was driving me nuts. My experience would seem to confirm
yours. Thanks to your post, I fixed a database update that was crashing my
R session. I changed the data column that I was posting from a POSIXct to a
Date, and now the data goes in. That works fine for me since my data
It helps to consider a small self-containd example
where the correct answer is obvious. Does the following
look like your input and desired output?
> a <- rbind(c("obj1-ptA-x", "obj1-ptA-y", "obj1-ptA-z"),
+c("obj1-ptB-x", "obj1-ptB-y", "obj1-ptB-z"),
+c("obj2-ptA-x"
On Aug 28, 2011, at 5:09 PM, marco wrote:
Hi everyone,
have a small problem trying to converting a dataset in matrix form
to an
array.
Specifically: data include 3D measurement -x,y,z of 59 points in 36
objects.
They are stored as a matrix (x) of 2124 rows and 3 columns.
What I want to do
Hi everyone,
have a small problem trying to converting a dataset in matrix form to an
array.
Specifically: data include 3D measurement -x,y,z of 59 points in 36 objects.
They are stored as a matrix (x) of 2124 rows and 3 columns.
What I want to do is to extract each subject's dataset using an arra
Uwe Ligges-3 wrote:
>
> On 27.08.2011 15:51, MK wrote:
>> Hi guys,
>>
>> I am having problem loading a package that I have installed. I have
>> searched
>> some old thread but they were no help in terms of solving the problem.
>>
>> I uninstalled every possible component of R and installed R 2.13
I have a vector with entries like "1,1,2,item1,item2" or "1,2,1,item1" that I
save as "file_name.txt" and then is transformed into a transaction by
calling:
data_ex <- read_baskets("file_name.txt", sep=",", info=
c("eventID","sequenceID","SIZE"))
as the first first three parts of the entry corr
It will greatly help if you provide a self-contained example, as requested in
the posting guide. Most of the times this will in fact lead to you figuring
out your problem yourself, but if not it will greatly enhance your chances
that we can help you in a meaningful, unambiguous way.
Best,
Daniel
Two things:
It's just a guess as to what your problem is, but functions in R don't
usually act on the object that is passed to them, but rather a copy thereof:
if you want to keep the values calculated within the function, that's
usually done with an assignment statement combined with the function
I corrected some of my syntax and changed the the glmStepAIC for glm and ti
worked. I tried my command lines with the mdrr dataset (after doing the first
cleaning steps as referred in the manual), the only difference is that I only
took first two columns because it took too much time with one v
I'm somewhat new to R, but I've had a lot of experience in Java.
I'm working on a function that takes data from a data frame, does some math
and assigns the values to a vector. Pretty simple. I plan to merge the
vector with the data frame when I'm done.
The vector is called offense1 (there will e
Hi,
I'm using the cspade function from the arulesSequences package on linux and
keep getting the error:
"Error in makebin(data, file) : 'sid' invalid"
any information on how to solve this would be much appreciated.
Thanks.
--
View this message in context:
http://r.789695.n4.nabble.com/cspad
> On Fri, Aug 26, 2011 at 10:20 AM, Benjamin Polidore
> wrote:
>> I have two distributions. Is there a statistical approach to determine
>> if the skew of distribution 1 is similar to the skew of distribution 2?
On Aug 26, 2011, at 10:07 PM, Joshua Wiley wrote:
> par(mfrow = c(2, 1))
> plot(de
Look into merge() or, if you want to work at
a lower level, match().
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf Of David Winsemius
> Sent: Sunday, August 28, 2011 11:0
On Aug 28, 2011, at 1:20 PM, Paul Hammer wrote:
Dear folks,
I would like to compare two unequal matrices.
"Unequal " is hardly an adequate data description.
At the moment I realize
this with two for loop and an if function but that's definitely too
slow
:(...
Here is my code:
for (i i
"I have simplified the code only to download the sp500 index."
Perhaps you have, but you haven't provided any of that simplified code so
I'm a little skeptical.
I do have to say though, if you've managed to do it more efficiently than
the 12 characters in getSymbols() you are a far better coder t
On Aug 28, 2011, at 18:12 , (Ted Harding) wrote:
>
> -log10(1/(10^307))
> # [1] 307
> -log10(1/(10^308))
> # [1] 308
> -log10(1/(10^309))
> # [1] Inf
>
> Note that the above forces R to compute the number before
> applying log10() to it. You can get a bit further with:
>
> -log10(1e-322)
Hi Michael:
I have simplified the code only to download the sp500 index. How to
correct this simple codes.
--
View this message in context:
http://r.789695.n4.nabble.com/How-download-Yahoo-Quote-tp3769563p3774672.html
Sent from the R help mailing list archive at Nabble.com.
___
Thank you Ted and David for prompt reply.
I can accept Inf but can not use for plotting, which I intend to do. May be
I can add 1/(10^308), so that if something comes to 0 will be in -log10
scale be 308.
Ram H
On Sun, Aug 28, 2011 at 12:12 PM, Ted Harding wrote:
> On 28-Aug-11 15:37:06, Ram H.
Can you provide a reproducible example and the results of
sessionInfo()? What are the levels of your classes?
On Sat, Aug 27, 2011 at 10:43 PM, Jon Toledo wrote:
>
> Dear developers,
> I have jutst started working with caret and all the nice features it offers.
> But I just encountered a problem
Dear folks,
I would like to compare two unequal matrices. At the moment I realize
this with two for loop and an if function but that's definitely too slow
:(...
Here is my code:
for (i in 1:length(all_expressed_genes[,1])) {
for (j in 1:length(kegg_gene_pVal[,1])) {
if (all_expressed_g
*Luca,
*
you may use survey package. You have to declare the design with design
function and than you can you svytotal, svyby, svymean functions to do your
tabulations.
Regards,
Leandro
Atenciosamente,
Leandro Marino
http://www.leandromarino.com.br (Fotógrafo)
http://est.leandromarino.com.br/
Hello,
I have to run a set of crosstabulations to which I need to apply some weights.
I am currently doing an unweighted version of such crosstabs using table(x,y).
I am used with SPSS to create a weighting variable and to use WEIGHT BY VAR
before running the CTABLES, is there a similar proced
On 28-Aug-11 15:37:06, Ram H. Sharma wrote:
> Dear R users:
> Sorry for this simple question:
>
> I am writing a function where I would need to pickup p values
> and make -log10 of it.
>
> The p values are from an anova output and sometime it can
> yield me 0.
>
> -log10 (0)
>
> [1] Inf
>
> I
On Aug 28, 2011, at 11:37 AM, Ram H. Sharma wrote:
Dear R users:
Sorry for this simple question:
I am writing a function where I would need to pickup p values and make
-log10 of it.
The p values are from an anova output and sometime it can yield me 0.
-log10 (0)
[1] Inf
I can not replace
I think that it should be possible to do this with the flexmix package.
Christian
On Fri, 26 Aug 2011, Andra Isan wrote:
Dear All,
I have two hidden classes for my data set that I would like to learn them based
on the Mixture of Binomial regression model. I was wondering if there is any
pac
On 26.08.2011 17:43, Simmons, Ryan wrote:
I am working with data from the USGS with data every 30 minutes from
4/27/2011 to 8/25/2011.
I am having trouble with setting the frequency.
My R script is below:
shavers=read.csv("shavers.csv")
names(shavers)
[1] "agency_cd""site_no"
Dear R users:
Sorry for this simple question:
I am writing a function where I would need to pickup p values and make
-log10 of it.
The p values are from an anova output and sometime it can yield me 0.
-log10 (0)
[1] Inf
I can not replace Inf with 0, which not case here.
This is restricting
Hi Josh,
thanks, that worked!
For the record, here is a function to determine the
number of strings, space-separated, in the first line
of a file:
# Removes leading and trailing whitespaces from string x:
trim = function(x) gsub("^\\s+|\\s+$", "", x)
# The number of strings in the first line in
On 27.08.2011 15:51, MK wrote:
Hi guys,
I am having problem loading a package that I have installed. I have searched
some old thread but they were no help in terms of solving the problem.
I uninstalled every possible component of R and installed R 2.13
May we assume R-2.13.1 is meant here?
On 25.08.2011 19:02, Noah Silverman wrote:
Hi,
I have function that I want to optimize. Am playing with the optim() function
in R
Two issues:
1) I can't seem to get it to work with a function that takes multiple inputs.
Dummy Example:
myFunc<- function(A,B,D,D){
A really dummy exampl
On 26.08.2011 20:27, . wrote:
Hi Ravi,
are you saying to apply the idea of a trapezoidal method "again", because I
was expecting the integrate() already do it for me. Is not the case?
I am also dealing with troubles related to integrate. Just to say, I tried
to figure out the problem in Mathe
On 26.08.2011 15:50, Paola Tellaroli wrote:
I lied, that was not my last question: how can I add two arrows at the
bottom with the words "in favor of A / B"? This is not specified in the pdf
and with "text" I have the impression that I can't add text below the
x-axis.
You can, see ?par and it
On 26.08.2011 23:41, Andrés Aragón wrote:
Hi, please help me,
I want to have a functional Rcmdr but after install as indicated in:
http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html
obtain the following:
Loading Tcl/Tk interface ... done
Loading required package: car
Loading r
Be careful about negating the 'which' in case there are no matches:
> x <- 1:10
> x[-which(x == 11)]
integer(0)
>
Notice it deletes the whole vector.
Safer to use logical vectors:
> x[!(x==3 | x == 7)]
[1] 1 2 4 5 6 8 9 10
> x[!(x == 11)] # notice this works
[1] 1 2 3 4 5 6 7 8
Hi Oliver,
Look at ?readLines
I imagine something like:
tmp <- readLines(filename, n = 1L)
(do stuff with the first line to decide)
IntN <- 6 (or 4)
NumN <- 8 (or whatever)
E <- read.table(file = filename, header = TRUE, colClasses =
c(rep("integer", IntN), "numeric", "integer", rep("numeric",
Hello,
I have a function for reading a data-frame from a file, which contains
E = read.table(file = filename,
header = T,
colClasses = c(rep("integer",6),"numeric","integer",rep("numeric",8)),
...)
Now a small variation arose, where
colClasses = c(rep("integer",4),"nu
Dear R users,
I'm currently trying to make level plots of a longitudinal study of the
spatio-temporal spread of a plant disease in a field, but the results of the
color key assignment isn't what I expect.
Here's more info. I recorded the level of a disease on an ordinal scale from
0 (no disease)
You can use 'which' and negative subscripts to remove elements from a vector.
y<-x[-(which(x==0|x==255))]
chuan_zl wrote:
>
> Dear All.
>
> I am Chuan. I am beginner for R.I facing some problem in remove element
> from vector.I have a vector with size 238 element as follow(a part)
>
> [1]
David Breimann gmail.com> writes:
>
> Hello,
>
> Sample code:
>
> library("vcd")
> dummy <- rnbinom(200, size=1.5, prob=0.8)
> gf <- goodfit(dummy, type="nbinomial", method="MinChisq")
> plot(gf)
>
> I would like to:
> 1. add a lgened stating the bars show the actual counts and the red
> dots
I think now everything should be fine and the problem should disappear.
And now about my problem. 'x' is not a set of residuals from an ARMA fit.
I just have 982 weekly quotations of a given stock index and I want to run a
Ljung-Box test on these data to test for autocorrelation. So 'x' would be
ex
Hi all,
i am trying to do some text mining in R. So far I managed to do some text
mining like TermDocumentMatrices and word count and similiar things.
What I would like to do is this :
I have a soil descriptions from borehole logs that corresponds to soil
classes. The problem is that some of th
FAQ 7.31
Sent from my iPad
On Aug 27, 2011, at 23:59, edwar...@psu.ac.th wrote:
> Dear all,
> I am happy to accept that
>
>> is.integer(1)
> [1] FALSE
>
> But I'm having difficulty with this one:
>
>> as.integer((2.53-2)*100)
> [1] 52
>
> especially since:
>
>> as.integer((1.53-1)*100)
> [1
Hello,
Sample code:
library("vcd")
dummy <- rnbinom(200, size=1.5, prob=0.8)
gf <- goodfit(dummy, type="nbinomial", method="MinChisq")
plot(gf)
I would like to:
1. add a lgened stating the bars show the actual counts and the red
dots - the fit.
2. show the goodness-of-fit values calculated somew
There is an url
"http://www.ozon.ru/context/detail/id/5254326/?type=6#buyalso";
If I try to get the data there (by "readLines" or whatever), R
downloads actually the content of this url
""http://www.ozon.ru/context/detail/id/5254326";
that is till the question mark.
What should I do to avoid the p
On 28-Aug-11 03:59:51, edwar...@psu.ac.th wrote:
> Dear all,
> I am happy to accept that
>
>> is.integer(1)
> [1] FALSE
>
> But I'm having difficulty with this one:
>
>> as.integer((2.53-2)*100)
> [1] 52
>
> especially since:
>
>> as.integer((1.53-1)*100)
> [1] 53
>
> Although I know that thi
On Aug 27, 2011 franco salerno wrote:
> ...problem with ordered probit model -polr function (library MASS).
> a) how to calculate marginal effects
> b) how to calculate the relative importance of each independent variables
Hi Franco,
Have a look at John Fox's effects package (for a), and the Ano
Dear all,
I am happy to accept that
> is.integer(1)
[1] FALSE
But I'm having difficulty with this one:
> as.integer((2.53-2)*100)
[1] 52
especially since:
> as.integer((1.53-1)*100)
[1] 53
Although I know that this is a precision issue since
> x <- (2.53-2)*100
> x-53
[1] -2.131628e-14
And
58 matches
Mail list logo