search for: mydataset

Displaying 20 results from an estimated 28 matches for "mydataset".

2009 Aug 06
1
Using 'field names' of a data.frame in a function
I may be doing this wrong! but I have a function which I have simplified a lot below. I want to pass some 'field names' of a data-frame to the function for it to then do some manipulation of. Here's my code: #build a simple dataset mydataset = data.frame ( ages=c('40-49','40-49','40-49','30-39','50-59','50-59','60-69','50-59'), sex = c("M","F","F","M","F","F","M","M")) #build a simple functio...
2009 Jul 28
5
Summarising Data for Forrest Plots
I tried to post this a few times last week and it seems to have got stuck somehow so I'm trying from a different email in the hope that works. If somehow this has appeared on the list 20 tiems and I never saw any of them I apologize ;-) I'm basically an R-newbie. But I am VERY computer literate. But this has me stumped... All the examples for using the rmeta package to create a
2007 Mar 03
2
format of summary.lm for 2-way ANOVA
...I am performing a two-way ANOVA (2 factors with 4 and 5 levels, respectively). If I'm interpreting the output of summary correctly, then the interaction between both factors is significant: ,---- | ## Two-way ANOVA with possible interaction: | > model1 <- aov(log(y) ~ xForce*xVel, data=mydataset) | | > summary(model1) | Df Sum Sq Mean Sq F value Pr(>F) | xForce 3 16.640 5.547 19.0191 1.708e-11 *** | xVel 4 96.391 24.098 82.6312 < 2.2e-16 *** | xForce:xVel 12 10.037 0.836 2.8681 0.0008528 *** | Residuals 371 108.194 0.292...
2013 Mar 25
1
count NAs with aggregate
Dear members of this list, I'd like to count missing values using the aggregate function. Something like this: count_nas <- function(arg1) { return(sum(is.na(arg1))) } aggregate(cbind(var1, var2, var3) ~ subject + time, data = mydataset, count_nas) It's not working: I end up with a matrix containing zeros, although there are missings in the data frame. I'd highly appreciate a hint! Thanks a lot, Timo Stolz
2013 Jul 12
2
vegan capscale 'subscript out of bounds' error
...ed principal coordinates analysis, and I kept getting the following error message: Error in Y.r[, oo, drop = FALSE] : subscript out of bounds I googled but I couldn't find an answer. Could anyone tell me why this error msg and what to do? Here is the command I used: mod=capscale(as.dist(dist)~mydataset$Var1+Condition(mydataset$Var2)) My dataset looks like the output of column-binding the 'varespec' and 'varechem' datasets, and has 92 rows and about 3500 columns. I also fed capscale a similarity matrix in the formula. Here is more info on the R version and the OS: R version 3.0.1...
2012 May 16
2
replacing with NA
...sis somehow so that my missing values are identified. I cannot use na.action function and that is why I have to drop my missing obesevations beforehand. library(fields) x <-1:20 y<- runif(20) z<- c(11, 15, 17, 2, 18, 6, 7, NA, 12, 10,21, 25, 27, 12, 28, 16, 17, NA, 12, 10) id <-1:20 mydataset<-data.frame(x, y, z) temperature[complete.cases(mydataset),] x<- temperature[, c(1)] y<- temperature[, c(2)] z<- temperature[, c(3)] tpsfit <- Tps(cbind(x, y), z, scale.type="unscaled") Many thanks as always. Regards, Mintewab
2010 Jul 29
2
ggplot2 histograms... a subtle error found
...I try to plot a histogram, allowing for ggplot2 to decide the binwidths itself, I get the following error: - stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. - Error: position_stack requires constant width My code is simply: ggplot(data=myDataSet, aes(x=myVarOI)) + geom_histogram() or qplot(myDataSet$myVarOI) If I go ahead and set the binwidth to some value, then the plot can be made without problems. The problem is with the specific data that it is trying to plot. I suspect it is trying to create bins of different sizes, from...
2002 Dec 10
1
lattice barchart with "negative" bars
Dear all, I'm trying to use the lattice barchart function to obtain a bar plot of a variable for different values of two factors. The thing I'm trying to do is something like this: > barchart(MyVar ~ season | place, data=mydataset) My problem is that the column MyVar has some negative values and I would like them to be represented as bars stacking down from zero instead of what the function does that is finding the minimum value and then stacking all bars from this minimum value up. I've looked into the the help page...
2004 Jul 30
1
optimisation procedure with flat log-likelihood
...method=c("L-BFGS-B"), ## I would like to do not use any bounds control=list(trace=6, ## just to see what it's going on maxit=c(20000)), ## to be sure the it doesn't stop reaching the max iterations data=mydataset) to optimize some demographic model. I assume that the log-likelihood is relatively flat because the estimated results are very similar to my starting values. In addition, I know the "real" parameters as I have used simulated data (which have been also found by using GAUSS and replicated...
2006 May 10
1
identify high dimension data point
...dimension data set. In high-dimension case , if I use pairs() + identify() in hope to observe all the components of the data point I selected, I get error message. Is there anyway to get around this ? Plus, I also need it to actually compare all the components of the picked data point with "mydataset" to choose the closest one. Thanks million in advance. best tong
2009 Apr 02
1
Start Klimt from R
Hello, I want to start Klimt from S.Urbanek directly from R. In the description of klimt is the following R-Code: source("klimt.r"); d<-read.table("mydataset.txt"); t<-tree(OUT2~.,d); Klimt(t,d); One should make sure, that the klimt.jar is in the working directory of R (in my case "C:\Program FilesR\R-2.8.1" I think). But although I copied klimt.jar into this folder, I get the R-error "unable to acces jarfile C:/Program"...
2010 Mar 23
0
multi-stage sampling and hierarchical models: which packages?
...roblem at the same time. Even if I just use the survey package I am not sure how to specify the model, because I have clusters within strata rather than strata within clusters. I guess it would look something like dstrat<-svydesign(id=~schoolC,strata=~region+urbanrural, weights=~newweight, data=mydataset,nest=T), but this gives the same results as dstrat<-svydesign(id=~schoolC,strata=~region, weights=~newweight, data=mydataset,nest=T) And I can't see any way to look at the mixed levels effects using that package. Perhaps I am better advised to use nlme; I guess I can just use the weights as...
2012 May 22
1
include a dataset in my package
Hey R-users, I think I followed the steps but still couldn't figure this out.. I am creating a personal package and I want to include several datasets in the package. I created a subdirectory 'data' in the package, save a dataset 'test.rda' there, built the package, checked it, installed it. Then I loaded the package and tried load(test), data(test), attach(test), none of them
2013 Apr 14
1
Aggregate function Bagging
...ith " bag". bag(x, y, B = 10, vars = NULL, bagControl = bagControl(), ...) bagControl(fit = NULL, predict = NULL, aggregate = NULL, downSample = FALSE) My fit function is: svmFit <- function(x, y, ...) { library(e1071) svm(Score~., data = mydataset) } My predict function is : svmPred <- function(object, x) { predict(object, x)[,1] } However, I don't know how to build the aggregate function. Does anyone know how to develop it? [[alternative HTML version deleted]]
2011 May 20
5
regression coefficient for different factors
Dear R-helpers, In my dataset I have two continuous variable (A and B) and one factor. I'm investigating the regression between the two variables usign the command lm(A ~ B, ...) but now I want to know the regression coefficient (r2) of A vs. B for every factors. I know that I can obtain this information with excel, but the factor have 68 levels...maybe [r] have a useful command. Thanks,
2024 Jan 30
1
R interpreting numeric field as a boolean field
Hi Bert, Below the information you asked me for: nrow(mydataset) [1] 2986276 ######## sapply(mydataset, "class") $`Transit Date` [1] "POSIXct" "POSIXt" $`Market Segment` [1] "character" $`N?mero de Tr?nsitos` [1] "numeric" $`Tar No` [1] "character" $`Beam Range (Operations)` [1] "character&q...
2007 Jan 04
2
memory limits in R loading a dataset and using the package tree
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070104/6e94ce08/attachment.pl
2003 Jun 14
1
Missing data augmentation
...minor of order 1 is not positive definite To be honest I have no idea whatsoever what that error message means, so my experiments with mice were shortlived :-) I then tried the package "norm". I got some ways with the experiment, following the help file: s <- prelim.norm(as.matrix(myDataSet)) thetahat <- em.norm(s) rngseed(1234567) theta <- da.norm(s, thetahat, steps=20, showits=TRUE) At this stage however I get the following error: Steps of Data Augmentation: 1...2...Error: NA/NaN/Inf in foreign function call (arg 2) This seems strange to me, since the whole purpose of this r...
2002 Feb 22
3
storing large data.frame's
I am new on R, so I have a maybe naive question: if I have many large data.frames and I use only one or two per session, what's the best way? If all are stored in the actual .Rdata, the system gets slow. On the other hand, I wouldn't like to make a separate package for the data. Should I save it with save() and then remove it with rm() ? Could I reload it then? Thanks for suggestions
2003 Jan 13
1
Fw: Plotting text-string real_date names at excel_date positions.
How do I post text-string dates along the x-axis instead of the excel_date position values? I would like to plot a time-series of chemical values changing with time The first column is the internal date from excel. This should be the x-axis position of a graph of the plotted data. The second column is a text-string of date. This should be what is posted (instead of the excel_date). The third