Solved

How to fix Error with Caret library and preProcess()

Posted on 2014-12-10
1
179 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Saved searches can save you time by quickly referencing commonly searched terms on any topic. Whether you are looking for questions you can answer or hoping to learn about a specific issue, a saved search can help you get the most out of your time o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now