similar to: Help: argument is not numeric or logical: returning NA

Displaying 20 results from an estimated 5000 matches similar to: "Help: argument is not numeric or logical: returning NA"

2016 Apr 22
1
Unique Ordering
Hi R-Help, data at bottom I've been struggling with a problem where I need to order based on 1) the Frequency "Freq" and 2) keeping each group of 3 of the same type together "Var2" but I want across all groups it to go "high to low" based on the earn factor. Thank you! structure(list(Var1 = structure(c(1L, 3L, 2L, 1L, 2L, 3L, 1L, 3L, 2L, 3L, 1L, 2L, 3L, 1L,
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help. #Reproducible script Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv") View(Empdata) str(Empdata) Empdata$gnipc<-as.numeric(Empdata$gnipc) install.packages("systemfit") library("systemfit") pdata <- plm.data(Empdata,
2013 Feb 27
2
matrix multiplication
Hi, Try this: #mat1 is the data res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7]-x1[2,7]))+(abs(x1[1,4]-x1[2,4])*abs(x1[1,8]-x1[2,8]))}));new1}))
2011 Nov 08
2
nesting scale_manual caracteristics in ggplot
Hi there, I am having a little problem with combining three scale_manual commands in a facet plot. I am not able to combine the three different characteristics, instead ending up with three different descriptions next to the graph for the same geom. I would like to see two separate labels (not three); one describing lines 1-7 and the other 8-14. For each of the treatments (A-B) I want a
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end. I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis. I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2008 Jul 06
2
lattice question
I'm creating a lattice barchart based off a pretty complicated data structure. The barchart comes out quite nice ( thanks to lattice ) but the problem is that the horizontal axis comes out all scrunched because the barchart doesn't know that the intervals of Var.1 are really "associated" with the conditioning variable Var.2. Therefore, all the intervals of Var.1 are put on
2017 Dec 06
0
Odd dates generated in Forecasts
> On Dec 6, 2017, at 5:07 AM, Paul Bernal <paulbernal07 at gmail.com> wrote: > > Dear friends, > > I have a weekly time series which starts on Jan 4th, 2003 and ends on > december 31st, 2016. > > I set up my ts object as follows: > > MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52) > > MyModel <- auto.arima(MyTseries, d=1, D=1)
2017 Dec 06
1
Odd dates generated in Forecasts
Thank you very much David. As a matter of fact, I solved it by doing the following: MyTimeSeriesObj <- ts(MyData, freq=365.25/7, start=decimal_date(mdy("01-04-2003"))) After doing that adjustment, my forecasts dates started from 2017 on. Cheers, Paul 2017-12-06 12:03 GMT-05:00 David Winsemius <dwinsemius at comcast.net>: > > > On Dec 6, 2017, at 5:07 AM, Paul
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel. #Reproducible script Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv") View(Empdata) install.packages("systemfit")
2011 Feb 17
0
Data frame sampling
R users, I have been trying to write a program in R that will extract rows from a data frame and combine the rows into a new smaller data frame while meeting several criteria. I would greatly appreciate any advice that could help me get started down the right path. What I want to do is to extract two rows WEEK (26 weeks total) from the data frame by sampling without replacement from the
2017 Dec 06
2
Odd dates generated in Forecasts
Dear friends, I have a weekly time series which starts on Jan 4th, 2003 and ends on december 31st, 2016. I set up my ts object as follows: MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52) MyModel <- auto.arima(MyTseries, d=1, D=1) MyModelForecast <- forecast (MyModel, h=12) Since my last observation was on december 31st, 2016 I expected my forecast date to start on
2013 Feb 08
2
Can not melt data.frame
I realize it's -12C and we're having the next best thing to a blizzard but why can I not melt this data frame. I am missing something terribly obvious but I just don't understand what the error message is saying. John Kane Kingston ON Canada Code and aata below #================================================# library(reshape2) melt(mydata, id.vars = c("date"))
2009 May 15
1
data summary and some automated t.tests.
I would like to preform a t.test to each of the measured variables (sand.silt etc.) with a mean and sd for each of the treatments (up or down), and out put this as a table.... I am having a hard time starting- maybe it is to close to lunch. Any suggestions would be greatly appreciated. Stephen Sefick x <- (structure(list(sample. = structure(c(1L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 2L, 3L,
2008 Oct 09
1
YALAQ - Yet Another LApply Question
Hello, Two lapply questions (system info and sample data below): 1) Why does the first form of command1 add the name of y _after_ the str() output rather than before as does the second (preferred) form? # command1 version1 invisible(lapply(ls(pattern='bn'), function(y) cat(y, "\n", str(get(y)), "\n") )) # command1 version2 (preferred output)
2010 May 19
2
contrasts for lmer model
hello, i found it most convenient to use package contrast for planned comparisons on mixed models. for instance i have a model with 2 fixed factors, one with 4 levels (stage) and one with 2 levels (gap) and a nested random factor (site) and i tested gap within level A of factor stage: library(contrast) library(nlme) m1<-lme(rich ~ stage*gap, random=~1|site,data=richness) contrast(m1, a =
2018 Jan 30
1
Could the Odds represent weight in Generalized Linear Model?
Dear Lenny, You can do this by using Age as an offset factor. dataset$wAge <- dataset$Age * 1.02 glm(cbind(Yes,No) ~ offset(wAge) + Times + Type, family=binomial, data = dataset) Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie &
2018 Jan 30
0
Could the Odds represent weight in Generalized Linear Model?
Dear Thierry, Thanks a lot for this answer, I mean i want to obtain such model *Behavior1 = ?0+?1*Age* , the purpose is to obtain *?1*. I want to be sure that the odds value could be the ?1. Or how to calculate it ? Thanks again for your precious help. Lenny <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
2018 Jan 30
2
Could the Odds represent weight in Generalized Linear Model?
Hello all, I'm sorry if my question seems basic. Im studying a responses (Yes,No) in a survey and, thanks to GLM I obtain the following relation with my variables : (Yes,No)~ ?0 + Age We note this this certain type of (Yes,No) response is linked to age (p<0.05 in glm) . After that we calculated : model1=glm(cbind(Yes,No) ~ Age + Times + Type, family=binomial) summary(model1)
2011 Jun 13
1
Heatmap in R and/or ggplot2
I have a dataframe df with columns x, y, and height. I want to create a heatmap-like plot that creates a grid of x by y, and then color codes the grid depending on the value of height. Is there a ggplot2 object to do this? I'm able to easily do this in Excel with pivot tables and conditional formatting so I'm including an image that is close to the output I want. I want to be able to
2016 Apr 21
1
Vegemite Function is Cowardly refusing
R version 3.2.2. library(vegan) I was to look at community tables from my dendrograms and am trying out the vegemite command. This is the error I get: Error in vegemite(apst, apst.clusters) : Cowardly refusing to use longer than 1 char symbols: Use scale I thought the problem was that I was using the log transformed data, but I tried it on the raw (which is single digit numbers), and still