similar to: On Reproducible Code

Displaying 20 results from an estimated 10000 matches similar to: "On Reproducible Code"

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.
2013 Oct 07
2
Need help with plotting the graph
Hello All, The version of R I am using is as follows > version _ platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 2 minor 14.1 year 2011 month 12 day 22 svn rev 57956 language R version.string R version 2.14.1 (2011-12-22) I just few days
2012 Aug 10
5
help error histograma
Hi, My error isErro em hist.default(dados[[1]], freq = TRUE, seq(0, 30, 0.5), prob = FALSE, : some 'x' not counted; maybe 'breaks' do not span range of 'x' hist(dados[[1]],seq(0, 30, 0.5), prob=TRUE, xlab="chuva (mm/dia)",ylab="frequĂȘncia", main="", cex.lab=1.6, cex.sub=3,cex.axis=3,cex.main=6) Someone help me? [[alternative
2012 Sep 26
3
rows extraction
Dear all, I want to extract rows from a data frame shown here as "test". For example: rows with with sorting PKB123 PKB22 PKB23 PKB32 CTV19 CTV20 PKB11 PKB11 > dput(test) structure(list(Name. = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 19L), .Label = c("CTV10", "CTV11", "CTV12",
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
2012 Aug 10
3
Trouble with Spatial Data Example Script
Dear All, I need to do something relatively simple: generate a map of Europe and paint the various states with different colors (only 3-4 are needed) according to a rule. I would like to keep it as simple as possible and the script resorting to the sp package that I found at http://bit.ly/Oc71ub is exactly what I am looking for (I need to repeat the exercise with Europe instead of
2012 Dec 16
3
averaging X of specific Y (latitude)
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X) latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I would like to have the average range size of every degree of latitude. For example, the average range
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",
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 Aug 03
2
Density plots
Dear group, I need help on two problems: 1. I am trying to plot density plots for each individual in 8 occasions. I can do this by subject wiht the code below: par(mfrow=c(4,2)) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==0])) plot(density(all8scenarios$SIMCONC[all8scenarios$ID==1&all8scenarios$WSEQ==1]))
2013 Apr 08
3
Reshaping a table
Hello all, I have data in the form of a table: X Y1 Y2 0.1 3 2 0.2 2 1 And I would like to transform in the form: X Y 0.1 Y1 0.1 Y1 0.1 Y1 0.1 Y2 0.1 Y2 0.2 Y1 0.2 Y1 0.2 Y2 Any ideas how? Thanks in advance, IOanna [[alternative HTML version deleted]]
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) >
2013 Mar 13
4
boxplot
Hi, I try to boxplot following data on the subset of (V1,V3,V5,V7) and (V2,V4,V6,V8) V1 V2 V3 V4 V5 V6 V7 V8 2 4 6 7 12 33 43 53 how can I use boxplot function to plot it? thanks, William
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
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
2013 Sep 04
2
Random products of rows in a matrix
Hello everybody, Without any loop and any package, I would like to return N products of M rows in a matrix A : Today, I managed to do it with a loop : B <- matrix(NA, ncol = ncol(A), nrow = 0) for (i in 1 : N) B <- rbind(B, apply(A[sample(1 : nrow(A), M, replace = T), ], 2, prod)) Do you have a solution ? Thank you in advance ! [[alternative HTML version deleted]]
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
2001 Dec 18
1
Missing users (who otherwise work fine)
Greetings We have a situation where we're trying to add a user to his local Administrators group on a Win2K/SP2 box, and his account is not showing up in the list of users in the domain (neither are some other accounts). Interestingly, these users are not showing up in the file security dialogs either. This seems like a new development (problem). The users are in the smbpasswd and NIS as