Displaying 20 results from an estimated 6000 matches similar to: "Missing users (who otherwise work fine)"
2017 Jun 01
1
Reversing one dimension of an array, in a generalized case
Thanks again. I am going to try the different versions. But I probably won't be able to get to it till next week.
This is probably at the point where anything further should be sent to me privately.
-Roy
> On Jun 1, 2017, at 1:56 PM, David L Carlson <dcarlson at tamu.edu> wrote:
>
> On the off chance that anyone is still interested, here is the corrected function using
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
On the off chance that anyone is still interested, here is the corrected function using aperm():
z <- array(1:120,dim=2:5)
f2 <- function(a, wh) {
idx <- seq_len(length(dim(a)))
dims <- setdiff(idx, wh)
idx <- append(idx[-1], idx[1], wh-1)
aperm(apply(a, dims, rev), idx)
}
all.equal(f(z, 1), f2(z, 1))
# [1] TRUE
all.equal(f(z, 2), f2(z, 2))
# [1] TRUE
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>>> junk1 <- junk[, rev(seq_len(10), ]
so that
junk[1,1,1 ] = junk1[1,10,1]
junk[1,2,1] = junk1[1,9,1]
etc.
The genesis of this is the program is downloading data from a variety of sources on (time, altitude, lat, lon) coordinates, but all
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
> On 1 Jun 2017, at 22:42, Roy Mendelssohn - NOAA Federal <roy.mendelssohn at noaa.gov> wrote:
>
> Thanks to all for responses/. There was a question of exactly what was wanted. It is the generalization of the obvious example I gave,
>
>>>> junk1 <- junk[, rev(seq_len(10), ]
>
>
> so that
>
> junk[1,1,1 ] = junk1[1,10,1]
> junk[1,2,1] =
2017 Jun 01
2
Reversing one dimension of an array, in a generalized case
My error. Clearly I did not do enough testing.
z <- array(1:24,dim=2:4)
> all.equal(f(z,1),f2(z,1))
[1] TRUE
> all.equal(f(z,2),f2(z,2))
[1] TRUE
> all.equal(f(z,3),f2(z,3))
[1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >"
[2] "Mean relative difference: 0.6109091"
# Your earlier example
> z <- array(1:120, dim=2:5)
>
2018 May 03
1
Converting a list to a data frame
>>>>> David L Carlson <dcarlson at tamu.edu>
>>>>> on Wed, 2 May 2018 21:43:52 +0000 writes:
> Typo: dat[[z]] should be x[[z]]:
>
> x2 <- do.call(rbind, lapply(names(x), function(z)
> data.frame(type=z, x[[z]])))
> x2
> type x y
> 1 A 1 3
> 2 A 2 4
> 3 B 5 7
> 4 B 6 8
>
>
2017 Jun 01
0
Reversing one dimension of an array, in a generalized case
??
> z <- array(1:24,dim=2:4)
> all.equal(f(z,3),f2(z,3))
[1] "Attributes: < Component ?dim?: Mean relative difference: 0.4444444 >"
[2] "Mean relative difference: 0.6109091"
In fact,
> dim(f(z,3))
[1] 2 3 4
> dim(f2(z,3))
[1] 3 4 2
Have I made some sort of stupid error here? Or have I misunderstood
what was wanted?
Cheers,
Bert
Bert Gunter
2013 Jun 01
1
error about MCA
Hi,all:
I want to perform multiple correspondance analysis via MCA{FactoMineR}.
The data is in the attachment.
My code:
dat<-read.delim("e:\\mydata.txt",header=T)
MCA(dat,quanti.sup=7,quali.sup=1:6)
Error in `[.data.frame`(tab, , i) : undefined columns selected
My question:
Why does the error happen?
Many thanks.
Best.
-------------- next part --------------
An embedded and
2017 Oct 25
0
as.data.frame doesn't set col.names
> On 24 Oct 2017, at 22:45 , David L Carlson <dcarlson at tamu.edu> wrote:
>
> You left out all the most important bits of information. What is yo? Are you trying to assign a data frame to a single column in another data frame? Printing head(samples) tells us nothing about what data types you have, especially if the things that look like text are really factors that were created
2023 Jun 13
1
log transform a data frame
Thank you so much David, here is correction:
d1=suppressWarnings(read.csv("/Users/anamaria/Downloads/B1.csv",
stringsAsFactors=FALSE, header=TRUE))
d1$X <- NULL
d2=as.matrix(sapply(d1, as.numeric))
pdf("~/graph.pdf")
b<-barplot(d2, legend= c("SYCL", "CUDA"), beside=
TRUE,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,80), col=c("#9e9ac8",
2018 Jun 01
0
Regroup and create new dataframe
No html!, Copy the list using Reply-All.
The data frame group_PrivateLabel does not contain variables called Product_Name or Region.
David C
From: nguy2952 University of Minnesota <nguy2952 at umn.edu>
Sent: Friday, June 1, 2018 2:13 PM
To: David L Carlson <dcarlson at tamu.edu>
Subject: Re: [R] Regroup and create new dataframe
Hi David,
your example is perfect!
I am still
2013 Jan 04
0
FW: Index out SNP position
I think you mean between column 1 and 2 of A? Why is 36003918 not
included? It is clearly between 35838396 and 36151202 in the first row of A.
My earlier solution should work fine. Just create a new matrix AX that has
the columns switched so that the start is always column 1 and use that to
identify the ones you want to select. That way you are not modifying B. This
will be faster than checking
2017 Nov 01
1
Function to save results
Hi David,Thank you for the example.When I try to use the cat function, I get an error
cat(attr<-getAttractors(net, type="asynchronous"))Error in cat(attr <- getAttractors(net, type = "asynchronous")) :
argument 1 (type 'pairlist') cannot be handled by 'cat'
Please let me know, if I have used the function in right way?.
Thank you
Priya
?
2017 Oct 25
1
as.data.frame doesn't set col.names
Hi Peter,
Thanks for contributing such a great answer. Can you please provide a
pointer to the documentation where it explains why dd$B <- s and dd["B"] <-
s have such different behavior?
(I am perfectly happy if you write the explanation but if it saves you time
to point to some reference that works fine for me.)
Regards,
Eric
On Wed, Oct 25, 2017 at 2:27 PM, Peter Dalgaard
2012 Jul 25
8
On Reproducible Code
We often refer requesters to the Posting Guide and chide them for not
reading it. Recently I had occasion to re-read the Posting Guide which is
for all R lists not just R-help. The word "reproducible" does not appear
anywhere in the guide. The closest it comes is the following suggestion:
"Sometimes it helps to provide a small example that someone can actually
run."
2018 May 02
0
Converting a list to a data frame
Typo: dat[[z]] should be x[[z]]:
x2 <- do.call(rbind, lapply(names(x), function(z)
data.frame(type=z, x[[z]])))
x2
type x y
1 A 1 3
2 A 2 4
3 B 5 7
4 B 6 8
David C
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of David L Carlson
Sent: Wednesday, May 2, 2018 3:51 PM
To: William Dunlap <wdunlap at tibco.com>; Kevin E.
2017 Jun 01
3
Reversing one dimension of an array, in a generalized case
Here is an alternative approach using apply(). Note that with apply() you are reversing rows or columns not indices of rows or columns so apply(junk, 2, rev) reverses the values in each column not the column indices. We actually need to use rev() on everything but the index we are interested in reversing:
f2 <- function(a, wh) {
dims <- seq_len(length(dim(a)))
dims <-
2018 Apr 18
0
nMDS with R: missing values
I'm not sure how you are incorporating time period into your data structure. Typically we are looking at plots or assemblages as the rows and taxa as the columns. Time period adds a third dimension that could be added as blocks of rows. For example, depending on the resolution of your data, one approach would be to have up to 8 rows for each locality: Loc1.1000, Loc1.2000, . . . Loc1.8000. If
2017 Oct 24
2
as.data.frame doesn't set col.names
You left out all the most important bits of information. What is yo? Are you trying to assign a data frame to a single column in another data frame? Printing head(samples) tells us nothing about what data types you have, especially if the things that look like text are really factors that were created when you used one of the read.*() functions. Use str(samples) to see what you are dealing with.
2018 Jun 01
0
Regroup and create new dataframe
Responses should be copied to r-help using ReplyAll. You are still sending html formatted emails. If you are using Microsoft Outlook, click the Format Text tab and select ?Aa Plain Text?. No one has asked you to reveal the data set, only to create one with a similar structure. Is the data I sent reasonably close? What should it look like after it is transformed?
David C
From: nguy2952