Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to fix Error with Caret library and preProcess()

Posted on 2014-12-10
1
187 Views
Last Modified: 2015-03-12
Hi, I am getting the following error:
Error in if (any(scaleValue == 0)) { : 
  missing value where TRUE/FALSE needed

Open in new window


How can I fix it?  Thank you.

my code:
library(caret)
# read data
features.adj.dfm1<-read.table("features_adj_dfm1k.txt",sep=" ",header=T,stringsAsFactors=F)

###### error after this function
trans<-preProcess(features.adj.dfm1,method=c("BoxCox","center","scale"),na.remove=T)

Open in new window

features-adj-dfm1k.txt
0
Comment
Question by:pgmerLA
1 Comment
 
LVL 17

Accepted Solution

by:
Thibault St john Cholmondeley-ffeatherstonehaugh the 2nd earned 500 total points
ID: 40494481
That text file is massive, and too big to read on my phone. All I see is a lot of numbers.

From your first Code showing the error it is telling you that the if statement is malformed.
It should be of the form:
If (condition, what if true, what if false)

Your second code entry doesn't show the line with that if statement.

As you have included an Any () statement in the if, I would suggest that you have miscounted the brackets and closed the if without including the true/false parameters.

you will need to post that actual line for me to check fully, but you can probably find it yourself if you count the braces.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally published Entrepreneur.com Booming numbers of freelancing professionals are changing the face of work. In the United States alone last year, the number of workers freelancing grew from 700,000 to 54 million, according to a Freelancers’…
Whether you believe the “gig economy,” as it has been dubbed, is the next big economic paradigm shift (https://www.theguardian.com/commentisfree/2015/jul/26/will-we-get-by-gig-economy) or an overstated trend (http://www.wsj.com/articles/proof-of-a-g…
Where to go on the main page to find the job listings. How to apply to a job that you are interested in from the list that is featured on our Careers page.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question