Solved

How to fix Error with Caret library and preProcess()

Posted on 2014-12-10
1
191 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Finding a job can be stressful - searches, resume tweaks, and networking events can be super boring. Luckily we're here to help you land your dream job!
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
Articles on a wide range of technology and professional topics are available on Experts Exchange. These resources are written by members, for members, and can be written about any topic you feel passionate about. Learn how to best write an article t…

691 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