Displaying 20 results from an estimated 56 matches for "styen".
Did you mean:
sthen
2023 Feb 12
2
Removing variables from data frame with a wile card
...tor.
>
>You could alternatively use
>
>x["V2"]
>
>which should be identical to x[, "V2", drop = FALSE], but some people don't
>like that because it doesn't look like matrix indexing anymore.
>
>
>On Sun, Feb 12, 2023, 17:18 Steven T. Yen <styen at ntu.edu.tw> wrote:
>
>> In the line suggested by Andrew Simmons,
>>
>> mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE]
>>
>> what does drop=FALSE do? Thanks.
>>
>> On 1/14/2023 8:48 PM, Steven Yen wrote:
>>
>...
2024 Feb 29
2
Initializing vector and matrices
...at you would normally catch with a subscript out of bounds error but with the extra space it now runs without errors.
Tim
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Richard O'Keefe
Sent: Thursday, February 29, 2024 5:29 AM
To: Steven Yen <styen at ntu.edu.tw>
Cc: R-help Mailing List <r-help at r-project.org>
Subject: Re: [R] Initializing vector and matrices
[External Email]
x <- numeric(0)
for (...) {
x[length(x)+1] <- ...
}
works.
You can build a matrix by building a vector one element at a time this way, and then re...
2024 Aug 09
3
If loop
...Or use <<- assignment I think. (I usually return, but return can only
> return one object and I think you want two or more
>
> v <- 1
> funC <- function() {
> v <<- v+1
> }
>
> funC()
> cat (v)
> #2
>
> On Fri, 9 Aug 2024, 09:03 Steven Yen, <styen at ntu.edu.tw> wrote:
>
> > Thanks. Hmm. The loop is doing what it is supposed to do.
> >
> > > try1<-function(joint12=FALSE,marg1=FALSE,marg2=FALSE,
> > + cond12=FALSE,cond21=FALSE){
> > + # **************************************************...
2023 Aug 06
2
Stacking matrix columns
You could also do
dim(x) <- c(length(x), 1)
On Sat, Aug 5, 2023, 20:12 Steven Yen <styen at ntu.edu.tw> wrote:
> I wish to stack columns of a matrix into one column. The following
> matrix command does it. Any other ways? Thanks.
>
> > x<-matrix(1:20,5,4)
> > x
> [,1] [,2] [,3] [,4]
> [1,] 1 6 11 16
> [2,] 2 7 12 17
>...
2023 Aug 06
1
Stacking matrix columns
...t may help guide a better answer.
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of Eric Berger
Sent: Sunday, August 6, 2023 3:34 AM
To: Bert Gunter <bgunter.4567 at gmail.com>
Cc: R-help Mailing List <r-help at r-project.org>; Steven Yen <styen at ntu.edu.tw>
Subject: Re: [R] Stacking matrix columns
Stacking columns of a matrix is a standard operation in multilinear
algebra, usually written as the operator vec().
I checked to see if there is an R package that deals with multilinear
algebra. I found rTensor, which has a function vec()....
2024 Aug 09
2
If loop
...) {
v <- v+1
return (v)
}
v <- funB()
cat (v)
#2
Or use <<- assignment I think. (I usually return, but return can only
return one object and I think you want two or more
v <- 1
funC <- function() {
v <<- v+1
}
funC()
cat (v)
#2
On Fri, 9 Aug 2024, 09:03 Steven Yen, <styen at ntu.edu.tw> wrote:
> Thanks. Hmm. The loop is doing what it is supposed to do.
>
> > try1<-function(joint12=FALSE,marg1=FALSE,marg2=FALSE,
> + cond12=FALSE,cond21=FALSE){
> + # ***************************************************
> + # Testing if loop
&g...
2024 Feb 29
1
Initializing vector and matrices
...s way,
and then reshaping it at the end. That only works if you don't need it to be
a matrix at all times.
Another approach is to build a list of rows. It's not a matrix, but a list of
rows can be a *ragged* matrix with rows of varying length.
On Wed, 28 Feb 2024 at 21:57, Steven Yen <styen at ntu.edu.tw> wrote:
>
> Is there as way to initialize a vector (matrix) with an unknown length
> (dimension)? NULL does not seem to work. The lines below work with a
> vector of length 4 and a matrix of 4 x 4. What if I do not know
> initially the length/dimension of the vector/...
2024 Mar 02
1
Initializing vector and matrices
...ipt out of bounds error but with the extra space it now runs without errors.
>
> Tim
>
>
>
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Richard O'Keefe
> Sent: Thursday, February 29, 2024 5:29 AM
> To: Steven Yen <styen at ntu.edu.tw>
> Cc: R-help Mailing List <r-help at r-project.org>
> Subject: Re: [R] Initializing vector and matrices
>
> [External Email]
>
> x <- numeric(0)
> for (...) {
> x[length(x)+1] <- ...
> }
> works.
> You can build a matrix by building...
2020 Oct 08
0
[External] Re: unable to access index for repository...
...definitely not "our" problem, so I suggest you start looking for a consultant if this issue is that important to you. Such is the nature of volunteer-developed open source software... so support your local experts.
>>
>>> On October 8, 2020 10:22:54 AM PDT, Steven Yen <styen at ntu.edu.tw> wrote:
>>> Thanks for the help. I have a reason to continue with R-3.0.3. I used
>>> maxLik to estimate econometric models and some of them are better
>>> handled with R-3.0.3 (but not later)----a sad reality I do not like.
>>>
>>> Her...
2020 Oct 08
2
[External] Re: unable to access index for repository...
Hi Steven
Which optimisation algorithms in maxLik work better under R-3.0.3 than
under the current version of R?
/Arne
On Thu, 8 Oct 2020 at 21:05, Steven Yen <styen at ntu.edu.tw> wrote:
>
> Hmm. You raised an interesting point. Actually I am not having problems with aod per se?-it is just a supporting package I need while using old R. The essential package I need, maxLik, simply works better under R-3.0.3, for reason I do not understand?specifically...
2024 Aug 09
1
If loop
...gt;
> marg1 <-T
>
> if (joint12) {
> ? print ("joint 12")
> ? cat (joint12)
> }
>
> if (marg1) {
> ? print("marg 1")
> ? cat(marg1)
> }
>
> Would probably be my diagnostic approach
>
>
> On Fri, 9 Aug 2024, 04:45 Steven Yen, <styen at ntu.edu.tw> wrote:
>
> Can someone help me with the if loop below? In the subroutine, I
> initialize all of (joint12,marg1,marg2,cond12,cond21) as FALSE,
> and call
> with only one of them being TRUE:
>
> ,...,joint12=FALSE,marg1=FALSE,marg2=FALSE,cond...
2023 Aug 06
1
Stacking matrix columns
...18 19 20
>
> ## well, you get it...
>
> -- Bert
>
> On Sat, Aug 5, 2023 at 5:21?PM Iris Simmons <ikwsimmo at gmail.com> wrote:
> >
> > You could also do
> >
> > dim(x) <- c(length(x), 1)
> >
> > On Sat, Aug 5, 2023, 20:12 Steven Yen <styen at ntu.edu.tw> wrote:
> >
> > > I wish to stack columns of a matrix into one column. The following
> > > matrix command does it. Any other ways? Thanks.
> > >
> > > > x<-matrix(1:20,5,4)
> > > > x
> > > [,1] [,2] [,3] [...
2023 Jan 14
2
Removing variables from data frame with a wile card
...t; grepl(glob2rx("yr*"), colnames(mydata))
>
> Then you might write something like this to remove the columns starting with yr:
>
> mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE]
>
>> On Sat, Jan 14, 2023 at 1:56 AM Steven T. Yen <styen at ntu.edu.tw> wrote:
>>
>> I have a data frame containing variables "yr3",...,"yr28".
>>
>> How do I remove them with a wild card----something similar to "del yr*"
>> in Windows/doc? Thank you.
>>
>>> colnames(mydata)...
2024 Jul 12
0
grep
which(grepl(....)) looks odd. Doesn't grep by itself return the correct vector of indices?
Regards,
Jorgen Harmse.?
Message: 5
Date: Fri, 12 Jul 2024 17:42:05 +0800
From: Steven Yen <styen at ntu.edu.tw <mailto:styen at ntu.edu.tw>>
To: Uwe Ligges <ligges at statistik.tu-dortmund.de <mailto:ligges at statistik.tu-dortmund.de>>, R-help Mailing List
<r-help at r-project.org <mailto:r-help at r-project.org>>
Cc: Steven Yen <syen04 at gmail.com <mai...
2024 Oct 04
1
apply
? Fri, 4 Oct 2024 20:28:01 +0800
Steven Yen <styen at ntu.edu.tw> ?????:
> Suppose I have two vectors, x and y. Is there a way
> to do the covariance matrix with ?apply?.
There is no covariance matrix for just two samples (vectors) 'x' and
'y'. You can only get one covariance value for these.
If you had a pair of vector...
2018 Mar 14
1
Documenting R package with Rd file
...ve
uhat<-m%*%y
but when the package is built (successfully), the matrix multiplication part does not show up in the documentation. The line become (missing %*% y)
uhat<-m
===
\examples{
x<-c(1,2,3,4,5)
y<-c(1,1,2,2,4)
x<-cbind(1,x)
m<-mmat(x)
uhat<-m%*%y
dstat(uhat)
}
?--
styen at ntu.edu.tw (S.T. Yen)
[[alternative HTML version deleted]]
2023 Aug 06
1
Stacking matrix columns
...swer.
>
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Eric Berger
> Sent: Sunday, August 6, 2023 3:34 AM
> To: Bert Gunter <bgunter.4567 at gmail.com>
> Cc: R-help Mailing List <r-help at r-project.org>; Steven Yen <styen at ntu.edu.tw>
> Subject: Re: [R] Stacking matrix columns
>
> Stacking columns of a matrix is a standard operation in multilinear
> algebra, usually written as the operator vec().
> I checked to see if there is an R package that deals with multilinear
> algebra. I found rTensor...
2024 Mar 26
1
Printout and saved results
...ossibly thousands of times and figuring out some slick way to summarize all those runs without thousands of printouts that you are not going to wade through anyway and would only slow the computer down (printing really does slow the computer down!)
On March 25, 2024 9:00:49 PM PDT, Steven Yen <styen at ntu.edu.tw> wrote:
>I just like the subroutine to spit out results (Mean, Std.dev, etc.) and also be able to access the results for further processing, i.e.,
>
>v$Mean
>
>v$Std.dev
>
>On 3/26/2024 11:24 AM, Richard O'Keefe wrote:
>> Not clear what you mean by &q...
2023 Jan 14
1
Removing variables from data frame with a wile card
mydata[, -grep("^yr",colnames(mydata))]
On Sat, Jan 14, 2023 at 8:57 AM Steven T. Yen <styen at ntu.edu.tw> wrote:
> I have a data frame containing variables "yr3",...,"yr28".
>
> How do I remove them with a wild card----something similar to "del yr*"
> in Windows/doc? Thank you.
>
> > colnames(mydata)
> [1] "year"...
2023 Jan 14
2
Removing variables from data frame with a wile card
I have a data frame containing variables "yr3",...,"yr28".
How do I remove them with a wild card----something similar to "del yr*"
in Windows/doc? Thank you.
> colnames(mydata)
? [1] "year"?????? "weight"???? "confeduc"?? "confothr" "college"
? [6] ...
?[41] "yr3"??????? "yr4"???????