similar to: str() options

Displaying 20 results from an estimated 4000 matches similar to: "str() options"

2008 May 06
2
list manipulation
Hello, I have a set of one-liners (many thanks to previous responses from this list) that I use to look at newly imported data sets with functions like dim(), names(), str(), etc. within lapply(). Generally, these commands work for me but, I am apparently still missing some aspect of list manipulation. I don't understand why I get a set of NULL list elements at the end of each output as
2008 Feb 12
3
Reorder data frame columns by negating list of names
Hello, I would like to reorder columns in a data frame by their names as demonstrated below: Take this data frame: > xxx <- data.frame(matrix(1:40, ncol=8)) > names(xxx) <- letters[1:8] > xxx a b c d e f g h 1 1 6 11 16 21 26 31 36 2 2 7 12 17 22 27 32 37 3 3 8 13 18 23 28 33 38 4 4 9 14 19 24 29 34 39 5 5 10 15 20 25 30 35 40 and reorder the columns like
2008 Oct 10
2
Fatal error: unable to restore saved data in .RData
Hello, I am unable to start an R session by double-clicking on an existing .RData file from the Windoze file explorer. A dialogue appears with the message "Fatal error: unable to restore saved data in .RData", and I notice in the R Console the last few lines are: "Loading required package: R2HTML NULL error in function () : unused argument(s) (1:43)" I tried starting
2008 Dec 09
2
assign()ing within apply
Hello, I'm trying to convert a character column in several dataframes to lower case. ### # # Sample data and 'spp' column summaries: # dput(ban.ovs.1993[sample(row.names(ban.ovs.1993), 20), 1:4]) ban.ovs.93 <- structure(list(oplt = c(43L, 43L, 38L, 26L, 35L, 8L, 39L, 1L, 34L, 50L, 10L, 29L, 31L, 24L, 18L, 12L, 27L, 49L, 28L, 51L), rplt = c(NA_integer_, NA_integer_,
2007 Nov 20
1
Process multiple columns of data.frame
Hello, How do I do the following more concisely? Bout[is.na(Bout$bd.n), 'bd.n'] <- 0 Bout[is.na(Bout$ht.n), 'ht.n'] <- 0 Bout[is.na(Bout$dbh.n), 'dbh.n'] <- 0 Would the form of such a command be different between numeric, character and factor columns? . . . between data.frames and matrices? Thanx, DaveT. ************************************* Silviculture
2008 Apr 09
3
Changing default plot behaviour
Hello, How would I make the default behaviour of my plots produce output such as the following (i.e. tick marks inside on all axes, labels only on two (arbitrary?) sides) without needing the five additional commands each time? plot(1:10, axes=FALSE) axis(1, tcl=0.5) axis(2, tcl=0.5) axis(3, tcl=0.5, labels=FALSE) axis(4, tcl=0.5, labels=FALSE) box() Thanx, DaveT.
2008 Jun 19
3
YAPMQ - Yet Another PlotMath Question
Hello, I'm having trouble finding (remembering) how to pass values into text functions in plots, as demonstrated by: slope <- 45 ; plot(1:10) ; text(2, 7, labels = expression(45~degree)) ; text(2, 5, labels = paste(bquote(.(slope)), expression(degree))) Thanx, DaveT. ************************************* Silviculture Data Analyst Ontario Forest Research Institute Ontario Ministry of
2008 Jan 17
2
Converting plots to ggplot2
Hello Hadley, I am trying to reproduce the following with ggplot: a <- seq(0, 360, 5)*pi/180 ; a ac <- sin(a + (45*pi/180)) + 1 ; ac plot(a, ac, type='b', xaxt = "n") axis(1, at=seq(0,6,1), labels=round(seq(0,6,1)*180/pi),1) abline(v=c(45*pi/180, 225*pi/180)) I can get the basic plot: p <- qplot(a, ac, geom=c('point', 'line')) ;
2008 May 26
1
SciViews and Tinn-R installation problem
Hello, I have just installed R 2.7.0 and re-installed SciViews 0.8-9 and Tinn-R 1.19.4.7 and seem to have broken something along the way as follows. I double-click on my current .RData file in the Windoze explorer, R Console and Tinn-R load successfully (?). I can list objects in my working directory with ls() but, when I attempt to refresh any list in the R explorer tab of the Tools child
2008 Mar 07
1
Finding Interaction and main effects contrasts for two-way ANOVA
I've tried without success to calculate interaction and main effects contrasts using R. I've found the functions C(), contrasts(), se.contrasts() and fit.contrasts() in package gmodels. Given the url for a small dataset and the two-way anova model below, I'd like to reproduce the results from appended SAS code. Thanks. --Dale. ## the dataset (from Montgomery) twoway <-
2010 Jun 09
4
question about "mean"
Hi there: I have a question about generating mean value of a data.frame. Take iris data for example, if I have a data.frame looking like the following: --------------------- Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2
2012 Aug 01
3
Neuralnet Error
I require some help in debugging this codeĀ  library(neuralnet) ir<-read.table(file="iris_data.txt",header=TRUE,row.names=NULL) ir1 <- data.frame(ir[1:100,2:6]) ir2 <- data.frame(ifelse(ir1$Species=="setosa",1,ifelse(ir1$Species=="versicolor",0,""))) colnames(ir2)<-("Output") ir3 <- data.frame(rbind(ir1[1:4],ir2))
2012 Jun 11
1
saving sublist lda object with save.image()
Greetings R experts, I'm having some difficulty recovering lda objects that I've saved within sublists using the save.image() function. I am running a script that exports a variety of different information as a list, included within that list is an lda object. I then take that list and create a list of that with all the different replications I've run. Unfortunately I've been
2005 Sep 26
3
How to get the rowindices without using which?
Hi, I was wondering if it is possible to get the rowindices without using the function "which" because I don't have a restriction criteria. Here's an example of what I mean: # take 10 randomly selected instances iris[sample(1:nrow(iris), 10),] # output Sepal.Length Sepal.Width Petal.Length Petal.Width Species 76 6.6 3.0 4.4 1.4
2008 Feb 08
1
Can I index a dataframe with a reference from/to a second dataframe?
Hello, I am unable to figure out how to code a new column in a data frame based on an existing column that matches a column in a reference data frame, in a relational-db fashion. I would like this to maintain a minimum set of reference tables that may be reused over several similar datasets. Specifically, I have two data frames as listed below, 'Bos' and 'tree.' For each case in
2008 Aug 07
6
multiple tapply
Hi folk, I tried this and it works just perfectly tapply(iris[,1],iris[5],mean) but, how to obtain a single table from multiple variables? In tapply x is an atomic object so this code doesn't work tapply(iris[,1:4],iris[5],mean) Thanx and great summer holidays Gianandrea -- View this message in context: http://www.nabble.com/multiple-tapply-tp18868063p18868063.html Sent from the R help
2004 Aug 21
2
more on apply on data frame
Hi R People: Several of you pointed out that using "tapply" on a data frame will work on the iris data frame. I'm still having a problem. The iris data frame has 150 rows, 5 variables. The first 4 are numeric, while the last is a factor, which has the Species names. I can use tapply for 1 variable at a time: >tapply(iris[,1],iris[,5],mean) setosa versicolor virginica
2011 Aug 16
3
Newbie question - struggling with boxplots
Hopefully I will not be flamed for this on the list, but I am starting out with R and having some trouble with combining plots. I am playing with the famous iris dataset (checking out example dataset in R while reading through Introduction to datamining) What I would like to do is create three graphs (combined boxplots) besides each other for each of the three species (Setosa, Versicolour and
2017 Oct 28
2
Cannot Compute Box's M (Three Days Trying...)
Hey Duncan, Hard to debug? That's an understatement. Eyes bleeding.... In any case, I tried all your suggestions. To get "integer" for the final column, I had to change the code to get integers instead of strings. double[] d1 = ((REXPVector) ((RList) tableRead).get(0)).asDoubles(); double[] d2 = ((REXPVector) ((RList) tableRead).get(1)).asDoubles(); double[] d3 = ((REXPVector)
2010 Feb 03
1
Calculating subsets "on the fly" with ddply
Hi, [I sent this to the plyr mailing list (late) last night, but it seems to be lost in the moderation queue, so here's a shot to the broadeR community] Apologies in advance for being more verbose than necessary, but I'm not even sure how to ask this question in the context of plyr, so ... here goes. As meaningless as this might be to do with the `iris` data, the spirit of it is what