search for: styen

Displaying 20 results from an estimated 45 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...
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 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...
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)...
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"???????
2024 Mar 02
1
Initializing vector and matrices
...ace 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] <- ... > > } > &...
2023 Jan 14
1
Removing variables from data frame with a wile card
...you'd rather you use globbing: 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) > [1] "year"...
2018 Jan 16
0
Merging RData files
...: overwriting existing objects. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Jan 16, 2018 at 12:43 AM, Steven Yen <styen at ntu.edu.tw> wrote: > I ran two separate hours-long projects. Results of each were saved to > two separate .RData files. > Content of each includes, among others, the following: > > me se t p sig > pc21.age 0.640 0.219 2.918 0.004 ***...
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...
2024 Mar 26
1
Printout and saved results
...w before you start writing the expression that you want to > save the value, > you can wrap the assignment in parentheses, making it an expression: > >> (retained.interesting.result <- function.with.interesting.result(......)) > > On Tue, 26 Mar 2024 at 15:03, Steven Yen <styen at ntu.edu.tw> wrote: >> How can I have both printout and saved results at the same time. >> >> The subroutine first return "out" and the printout gets printed, but not >> saved. >> >> I then run the "invisible" line. Results got saved and...