search for: jwiley

Displaying 20 results from an estimated 84 matches for "jwiley".

Did you mean: wiley
2010 Jun 02
8
bind select data frames
Dear group, Here is my environment: > ls() [1] "DailyPL100419" "DailyPL100420" "DailyPL100421" "dd" "i" "l" "PLglobal" "Pos100416" "Pos100419" "Pos100420" "Pos100421" "position" [13] "result" "sel"
2010 Nov 20
10
An empty grey diagram
Hi folks, Win7 64bit R 1.12.0 I run following command on R:- > ToothGrowth > attach(ToothGrowth) > plot(dose,len) > matrics=lm(len~dose) > abline(metrics) Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet Only a grey diagram is displayed without content > plot(abline(metrics)) Error in int_abline(a = a, b = b, h = h, v
2011 Mar 13
4
readMat - how to retrieve the variables
Hello I have a matlab MAT file that contains one single variable: a. The structure of a is as follows: a.river1.flow (flow values) a.river1.date_flow (date) a.river1.precip (precipitation values) a.river1.date_precip a.river2.flow a.river2.date_flow a.river2.precip a.river2.date_precip I have used readMat to load the variable a in R, however I have no idea how readMat translates a. I managed
2010 Jan 14
5
Better way than an ifelse statement?
Hello All, I am trying to create a column of weights based off of factor levels from another column. I am using the weights to calculate L scores. Here is an example where the first column are scores, the second is my "factor" and the third I want to be a column of weights. I can do what I want with an ifelse statement (see below), but I am wondering if anyone knows of a cleaner way
2011 May 28
2
reduce printing accuracy
Dear all, I would like to print a few values with less digits than the default. How I can reduce how many digits are printed ?(warning: not the real integer resolution but what is shown in screen) Best Regards Alex
2010 Nov 09
5
Question regarding to replace <NA>
Dear r-users, Basically, I have a data as follows, > data S s1 s2 s3 s4 s5 prob obs num.strata 1 NNNNN N N N N N 0.0000108 32 <NA> 2 NNNNY N N N N Y 0.0005292 16 <NA> 3 NNNYN N N N Y N 0.0005292 24 <NA> 4 NNNYY N N N Y Y 0.0259308 8 1 .... I want to replace <NA> by 0, when I tried the following
2010 Nov 02
5
Question about ggplot2
Dear All, I am trying to graph a simple scatter plot where the x axis is year and the y axis is a percentage (percentage of infant death). Instead of plotting the raw data, I want to plot summary statistics such as mean and median. Here is the problem: the value range of y is between 0 and 1, but since infant death is a rare event, the mean and median is very low (something like 5%), which shows
2010 Oct 08
5
saving object function
Ok so if I have a function: functest<-function(x){ a<-x+1 b<-x+2 c<-x+3 paste(a) paste(b) paste(c) } Now I know I can do cat(), or return() on one of them but if I was to run the function with any number, how could I create objects to save so I could do, I am wondering if I have more than one object within my function. functest$a
2014 Aug 07
2
How to (appropropriately) use require in a package?
Dear All, What is the preferred way for Package A, to initialize a cluster, and load Package B on all nodes? I am writing a package that parallelizes some functions through the use of a cluster if useRs are on a Windows machine (using parLapply and family). I also make use of another package in some of my code, so it is necessary to load the required packages on each slave once the cluster is
2011 Sep 12
5
completing missing samples
Hello, I have a time-series that has some missing samples. I was thinking on completing them using either zero-order hold or linear interpolation. I am looking for an efiicient way (other than a loop...) of identifiying the missing time slots and filling them. Can you think of any methods that might help here? (obviously which(diff(time)>min(diff(time))) will give the locations, but what
2010 Oct 07
6
Deleting observations - can't see the data after that
Hello all, I am loading a data frame, fitting a model, getting diagnostic plots and they are flagging a couple of observations as problematic. Fair enough, and I want re-fit without them. After I delete an offending row (identified by one of the diagnostic plots), something like data = data[-3,]; then R will no longer print the contents of the data frame; it tells me it is a data frame
2011 Jan 06
5
Problem with timeSequence {timeDate} - wrong end date
Dear help-list, I have a problem with timeSequence {timeDate}. When I use it like > timeSequence(from = "2008-01-01", to = "2010-12-13", by = "1 month") GMT [1] [2008-01-01] [2008-02-01] [2008-03-01] [2008-04-01] [2008-05-01] [2008-06-01] [2008-07-01] [2008-08-01] [2008-09-01] [2008-10-01] [2008-11-01] [12] [2008-12-01] [2009-01-01] [2009-02-01] [2009-03-01]
2011 Aug 23
3
GLM question
Hi All, I am trying to fit my data with glm model, my data is a matrix of size n*100. So, I have n rows and 100 columns and my vector y is of size n which contains the labels (0 or 1) My question is: instead of manually typing the model as glm.fit = glm(y~ x[,1]+x[,2]+...+x[,100], family=binomial()) I have a for loop as follows that concatenates the x variables as follows: final_str=NULL for
2012 Mar 13
2
sort list
Hello can anyone help please? i read two words "cell1", "cell2" into a list. I want to turn this list into a factor. > cell_data <-list(c('cell1','cell2')) > cell_data [[1]] [1] "cell1" "cell2" > factor_list <- factor(cell_data) Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called
2011 Jun 21
5
omitting columns from a data frame
Dear R People: I have a data frame, xm1, which has 12 rows and 4 columns. If I put is xm1[,-4], I get all rows, and columns 1 - 3, which is as it should be. Now, is there a way to use the names of the columns to omit them, please? Thanks so much in advance! Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown
2011 Jan 10
2
Calculating Portfolio Standard deviation
Dear R helpers I have following data stocks <- c("ABC", "DEF", "GHI", "JKL") prices_df <- data.frame(ABC = c(17,24,15,22,16,22,17,22,15,19),                                          DEF = c(22,28,20,20,28,26,29,18,24,21),                                           GHI = c(32,27,32,36,37,37,34,23,25,32),                                          
2010 Jun 24
8
Install package automatically if not there?
Hi fans, is it possible for a script to check if a library has been installed? I want to automatically install it if it is missing to avoid scripts to crash when running on a new machine... Ralf
2012 Feb 03
2
Assigning objects to variable and variable to list in a for loop
Hello, I want to use a for loop for repeadely calculating a maxent model (package dismo, function maxent()) which creates an object of the class maxent (S4). I want to collect all the resulting object in a list. I tried to simplify my for loop to explain what I want. There are two problems/questions: 1) How can I create the new variables in the loop (using paste) and assign the objects 2) How
2010 Sep 17
1
how to work with Year-Month dates
Hi all, Is there a built in or easier way to work with dates that are *just* Year-Month? Right now I paste() on a day as a work around, but it ultimately needs to be in Year-Month form, so then I use format() to get rid of the day. x <- c("2006-December", "2006-July") x <- paste(x, "-01", sep='') x <- as.Date(x, "%Y-%B-%d") x <- sort(x)
2010 Oct 05
2
accessing elements located after $ symbol
Hi R-users I am having troubles accessing elements after the $ symbol. Reproducible example: >test <- data.frame (first=1:10, second=11:20, third=21:30) >test$first #this works fine but when I try >interest <- "first" >test$interest # does not seem to work Could you tell me why that happens and show how to do instead? Thanks so much Lorenzo