Displaying 20 results from an estimated 32 matches for "tmrsg11".
2013 Jul 18
1
Looking for knitr example for beginner (NO RStudio)
Hi everyone,
I am using package knitr, FIRST TIME. I don't have access to RStudio.
Read through Yihui's page, didn't find it helpful. Stuck on terms
Rnw, GFM (GitHub Flavored Markdown). Never used Sweave, so the
reference is not helping.
Is there a simple step-by-step example WITHOUT RStudio?
My question:
What is the procedure? The documentation explains the functions, but
does
2012 Dec 05
3
data manipulation between vector and matrix
Dear list,
I was curious how to subtract a vector from matrix?
Say, I have
mat <- matrix(1:40, nrow=20, ncol=2)
x <-c(1,2)
I want,
x-mat[1,] and x-mat[2,], and so on... Basically, subtract column elements
of x against column elements in mat.
But x-mat won't do it.
Thanks,
Mike
[[alternative HTML version deleted]]
2017 Oct 20
0
What exactly is an dgCMatrix-class. There are so many attributes.
.... 1
cap-shape=flat cap-shape=knobbed
[1,] . .
[2,] . .
[3,] . .
[4,] . .
[5,] . .
On Fri, Oct 20, 2017 at 3:51 PM, C W <tmrsg11 at gmail.com> wrote:
> Thank you for your responses.
>
> I guess I don't feel alone. I don't find the documentation go into any
> detail.
>
> I also find it surprising that,
>
> > object.size(train$data)
> 1730904 bytes
>
> > object.size(as.matrix(...
2017 Oct 20
4
What exactly is an dgCMatrix-class. There are so many attributes.
...0904 bytes
> object.size(as.matrix(train$data))
6575016 bytes
the dgCMatrix actually takes less memory, though it *looks* like the
opposite.
Cheers!
On Fri, Oct 20, 2017 at 3:22 PM, David Winsemius <dwinsemius at comcast.net>
wrote:
>
> > On Oct 20, 2017, at 11:11 AM, C W <tmrsg11 at gmail.com> wrote:
> >
> > Dear R list,
> >
> > I came across dgCMatrix. I believe this class is associated with sparse
> > matrix.
>
> Yes. See:
>
> help('dgCMatrix-class', pack=Matrix)
>
> If Martin Maechler happens to respond to this...
2012 Nov 29
3
How to subtract the counter i in for loop?
Hi list,
I am writing a for loop that looks like this:
samples<-rep(NA,10)
x <- rep(c(111, 225), 5)
for(i in 1:10){
If(x[i]<200){
samples[i] <- x[i]
}else{
i=i-1
}
}
The problem is that the returning vector still contains NA, I think the i
in "else" is not getting subtracted. How should I get it to work?
Thanks,
Mike
[[alternative HTML version
2017 Oct 21
0
What exactly is an dgCMatrix-class. There are so many attributes.
>>>>> C W <tmrsg11 at gmail.com>
>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
> Thank you for your responses. I guess I don't feel
> alone. I don't find the documentation go into any detail.
> I also find it surprising that,
>> object.size(train$dat...
2017 Oct 20
3
What exactly is an dgCMatrix-class. There are so many attributes.
Dear R list,
I came across dgCMatrix. I believe this class is associated with sparse
matrix.
I see there are 8 attributes to train$data, I am confused why are there so
many, some are vectors, what do they do?
Here's the R code:
library(xgboost)
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
2012 Nov 15
3
how to view source code of a function inside a package?
Dear list,
I am trying to look at the function inside a package. I know that
methods() would do the trick, but what if the function is hidden? I have a
problem displaying the hidden function.
Say, for example the MCMC package. How do you view the code of that
function?
something like this:
> which
function (x, arr.ind = FALSE, useNames = TRUE)
{
wh <- .Internal(which(x))
if
2013 Apr 18
2
How to keep plot title same as column name using apply/sapply?
Dear list,
I am trying to plot histogram of a 10 by 5 matrix by columns.
What is a good way to paste the column names?
dput(a)
structure(c(0.891856482875103, 0.249593821948295, 0.0385066520473322,
0.109098868876336, 0.238035894186719, 0.971470380855763, 0.168018536530906,
0.941457062296419, -0.285381460315397, -0.0229335863796271, -20138.175683257,
28190.7238887329, 8521.44473371867,
2017 Oct 21
1
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 21, 2017, at 7:50 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
>>>>>> C W <tmrsg11 at gmail.com>
>>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
>
>> Thank you for your responses. I guess I don't feel
>> alone. I don't find the documentation go into any detail.
>
>> I also find it surprising that,
>
>>> obj...
2013 Apr 12
3
Why copying columns of a data.frame becomes numeric?
Dear list,
I want the 1st, 2nd, 5th, and 6th columns of mtcars. After copying them,
the columns become numeric class rather than data frame.
But, when I copy rows, they data frame retains its class. Why is this? I
don't see why copying rows vs columns is so different.
> class(mtcars)
[1] "data.frame"
> head(mtcars)
mpg cyl disp hp drat wt qsec vs
2012 Oct 07
3
what exactly is the dim of data set yarn in package "pls"?
Hi list,
I am looking at the data yarn in package, I don't understand what is
dimension of this data set.
I did the following:
> library(pls)
> data(yarn)
> dim(yarn)
[1] 28 3
> head(yarn)
NIR.1 NIR.2 NIR.3 NIR.4 NIR.5 NIR.6 NIR.7 NIR.8 NIR.9
NIR.10 NIR.11
1 3.06630 3.08610 3.10790 3.09720 2.99790 2.82730 2.62330 2.40390 2.19310
2.00580 1.83790
2
2017 Oct 20
0
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 20, 2017, at 11:11 AM, C W <tmrsg11 at gmail.com> wrote:
>
> Dear R list,
>
> I came across dgCMatrix. I believe this class is associated with sparse
> matrix.
Yes. See:
help('dgCMatrix-class', pack=Matrix)
If Martin Maechler happens to respond to this you should listen to him rather than anything I wr...
2012 Apr 11
1
Error using return() function inside for loop and if statement
Dear all, I get an error using the return function. The following is a
simpler version.
for (j in 1:10)
{
samples = 5*j
return(samples)
}
Error: no function to return from, jumping to top level
Similar warning happens with if statement.
Why do I get an error? print() works fine. I don't see anywhere in the
documentation says that return() is not allowed inside for loop.
I know
2012 Jul 10
1
calculating the difference between days?
Hi List,
I have one column of beginning dates and one column of ending dates, I want
to find their difference. And I want to ignore the trailing zeros,
basically everything after the first colon mark.
Begin_date End_date
01JAN2000:00:00:00:000 02FEB2002:00:00:00:000
24MAR2012:00:00:00:000 18MAY2012:00:00:00:000
01OCT2003:00:00:00:000
2013 Jan 24
1
Recommendation for website to format R code
Hi list,
Could anyone recommend some good website for formatting R code? For
example, when you copy paste R code to gmail and back to R, it loses its
format, the dash symbol causes errors.
I've had someone used it to format my code here on the list, but can't find
it anymore.
Mike
[[alternative HTML version deleted]]
2012 Aug 14
2
What package to use to calculate odds ratio and the confidence interval?
Hi list,
I am trying to calculate the sensitivity, specificity, and odds ratio(and
confidence interval).
Say, my data looks like this
42.53, 37.56, 40.51, 32.67, 38.19, 81.74, 41.55, 68.94, 59, 63, 54.13,
48.85, 50.46, 51.78
Is there any packages in R that does this? Espeically the odds ratio
confidence interval.
Mike
[[alternative HTML version deleted]]
2013 Feb 20
2
Why R simulation gives same random results?
Hi, list
I am doing 100,000 iterations of Bayesian simulations.
What I did is I split it into 4 different R sessions, each one runs 25,000
iteration. But two of the sessions gave the simulation result.
I did not use any set.seed(). What is going on here?
Thanks,
Mike
[[alternative HTML version deleted]]
2012 Jun 21
2
How to calculate values with percent sign imported from Excel?
Hi R list,
I imported values from Excel, there is a column with numbers like 45%, 65%,
12%.
I want to find its mean. What should I use?
strisplit()
split()
parse()
Data from dput(),
structure(c(78L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("",
"-0.15%", "-0.34%", "-1.3%", "-10.77%", "-100.00%", "-11.45%",
2013 Mar 01
2
using reserved words in R, and reuse variable names in different functions
Hi list,
I am writing several functions and running out variable names. I am using
words such as "t", "c", "matrix" to keep the notation same as formulas I am
using.
For example I have,
unnormalized <- function(t, x, y){
val <- rnorm(t, mean=x, var=y)
return(val)
}
metropolis <- function(t, c, x, y){
den1 <- unnormalized(t, mean=x, sd=y)